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.
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.