Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for image approvals based on a similarity percentage threshold #55

Open
vinaysshenoy opened this issue Oct 2, 2019 · 3 comments

Comments

@vinaysshenoy
Copy link

I had a use-case where I was refactoring a tool that was used for generating PDFs (with Apache PDFBox). I used approval tests to verify the images rendered using the PDFs as approvals. However, there was a problem where the renderer would generate slightly different images on different platforms. This caused problems where I had to create new approvals every time I changed the system I was working on, as well as won't work well with CI.

To solve this, I wrote a different image approver using an image similarity check and the gist is available HERE. This is written in Kotlin, and would be easily portable to Java. I'd love to contribute this back to the project. Would this be something that you'd like to get into the project? I can raise a PR if so.

@AndrzejProchyra
Copy link

I have just encuntered this very usecase. We attempted to use AwtApprovals for a PDF rendered to an image via PDFBox. It works fine locally but fails in CI, very possibly due to "irrelevant" rendering differences. Being able to set a threshold for an image match would be most welcome.

@LarsEckart
Copy link
Contributor

I set a reminder so that I hopefully remember next Monday when we get together and work on ApprovalTests again.
Let's see what we can do about this issue :)

@isidore
Copy link
Member

isidore commented Dec 4, 2023

yes, we would like to take a look at, but also remember that machine specific namers help for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants