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

Add difference percentages to CompareResult #108

Merged
merged 3 commits into from
Aug 12, 2021
Merged

Add difference percentages to CompareResult #108

merged 3 commits into from
Aug 12, 2021

Conversation

LennartKoot
Copy link
Contributor

Saw #79 open for a while and decided to give a solution a try.

This PR will add Map<Integer, Double> getPageDiffsInPercent() to the CompareResult interface, exposing a collection of difference percentages mapped to their respective page index.

There is a special case in PageDiffCalculator where totalPixels can be zero. In this case I decided to return 0% when there are no differences, and 100% when there are differences, since there is nothing to calculate the percentage with. I'm not sure if this is the correct way to go, so please let me know if you have different ideas.

@LennartKoot LennartKoot changed the title Add difference percentage to CompareResult Add difference percentages to CompareResult Aug 10, 2021
@finsterwalder finsterwalder merged commit 856e99e into red6:master Aug 12, 2021
@finsterwalder
Copy link
Collaborator

Thanks a lot for taking the time to improve PdfCompare!

@finsterwalder
Copy link
Collaborator

Version 1.1.60 is released and should land in maven central during the next couple of hours.

@LennartKoot LennartKoot deleted the diff-percent branch August 12, 2021 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants