I have a library that produces images from code, and I would like to write a capability test suite that loops over a number of test cases and does the following:
- Create a PNG image from the test case,
- create a checksum of the image, and
- assert that the checksum is the same as the reference checksum.
By comparing with precomputed reference checksums, I can be sure that the behavior or the library doesn't change without checking the images pixel by pixel.
I noticed that when creating PNGs, no two files are exactly alike although they look alike. I suppose a time stamp of sorts is always stored in the file. This rules (plain) PNG files out for this purpose.
What is an appropriate file format/hash algorithm for asserting that the visual output doesn't change?
Aucun commentaire:
Enregistrer un commentaire