moshensky / pdf-visual-diff

Visual Regression Testing for PDFs in JavaScript
MIT License
40 stars 17 forks source link

comparePdfToSnapshot returns false when files are visually the same but size is different #47

Closed AntonioLok closed 2 years ago

AntonioLok commented 2 years ago

Hello,

I finally was able to get it working on my docker container. I saved an initial snapshot and now I am comparing it against a new pdf (same content visually) but the size is a bit different. I should expect comparePdfToSnapshot to return true but its returning false. is this expected? If so, is there a way to only compare it visually?

I have attached old and new pdf generated as well as the .diff file. I compared it manually and also through https://www.diffchecker.com/image-diff/.

expectedTile2PDFBuffer new expectedTile2PDFBuffer diff expectedTile2PDFBuffer

moshensky commented 2 years ago

Hi @AntonioLok,

I've run your new and orig images via v0.6.0 comparison function and got a bit different diff. It is clear that there are changes in the images and probably fonts. What I would have done is to check if the new image would compare successfully, i.e. rename the new image as orig and run test again.

P.S. Could you please edit your post so that image links won't be embedded for easier readability please?

AntonioLok commented 2 years ago

@moshensky Sorry for late reply. This is no longer an issue, it was a problem on my end!

moshensky commented 2 years ago

@AntonioLok no worries, I'm glad that you have solved it!