itgalaxy / favicons

Favicons generator for Node.js
MIT License
1.19k stars 164 forks source link

Upgrade minimum version of sharp to 0.32.4 #436

Closed lovell closed 1 year ago

lovell commented 1 year ago

The prebuilt binaries provided with latest version of sharp include zlib-ng v2.1.3, which is significantly faster but when encoding can produce a slightly different compressed byte stream when run on different CPU hardware (the decompressed byte stream is identical). This will affect tests that rely on an exact match of compressed PNG data.

The change in this PR ensures the existing PNG to SVG test assertions are deterministic by carrying out the reverse SVG to PNG conversion before verification, which means we can rely on existing similarity thresholds instead of a snapshot of exact bytes.

lovell commented 1 year ago

Thanks for merging, and thank you for continuing to maintain the very useful tool that is favicons!