Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
weboob
weboob
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 180
    • Issues 180
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 53
    • Merge Requests 53
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • weboob
  • weboobweboob
  • Merge Requests
  • !473

Open
Opened Jun 11, 2020 by Ludovic LANGE@llange
  • Report abuse
Report abuse

[boursorama] Fix the virtual keyboard

  • Overview 1
  • Commits 3
  • Pipelines 10
  • Changes 2

The previous implementation relied on the presence, in the SVG, of an id representing the number. Unfortunately this id quickly disappeared, leaving us without an easy way to identify the number.

For a more reliable implementation, I choose to use a perceptual hash to allow for small differences in the image comparison. (The same approach that was in place before 69664cc4, but with a slightly different implementation)

However, SVG reading / rendering in python seems a complex issue, for which I unfortunately had to add some new dependencies:

  • cairosvg to read the SVG images
  • dhash to compute a similarity

(Note: cairosvg has itself some dependencies, that may be difficult to fetch, thus this should be taken into account when evaluating this MR)

dhash has not seen much changes since 2017, but is so simple that it may be stable enough for our use. We may also replace it with another perceptual hash implementation, the idea is to ease the comparison between a reference image, so that any (slight) variation of the SVG image can be worked around.

(I'm not so easy with a hash of the SVG 'content' as it's very easy to change the content of the SVG -thus changing the hash- without changing the resulting image. Thus I prefer to work on the resulting image, which means necessity to convert the SVG to a raster image. A perceptual hash is quicker than an OCR but should cope with slight modifications of the images.)

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch "https://git.weboob.org/llange/weboob.git" "boursorama-fix-virtual-keyboard"
git checkout -b "llange/weboob-boursorama-fix-virtual-keyboard" FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "origin/master"
git merge --no-ff "llange/weboob-boursorama-fix-virtual-keyboard"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: weboob/weboob!473