Donaldcwl / browser-image-compression

Image compression in web browser
MIT License
1.3k stars 160 forks source link

Different md5sum between the same file compressed two times #120

Closed EduardoThums closed 3 years ago

EduardoThums commented 3 years ago

I don't know exactly how the image is compressed under the hood, but it makes sense if the same file, compressed two times using the same options, generates the same md5sum?

I notice that even using the same options, the md5sums are not the same. Is this a specific characteristic of this compress implementation or its something normal under all the compress processes available, since they probably change some underling bytes, etc.

Donaldcwl commented 3 years ago

For jpg files, the checksums are the same for multiple compressions. For png files, the compression algorithm involves randomness, so it is normal to have different checksums.