Closed ericlaw1979 closed 9 years ago
Do you know how this can be fixed by passing different parameters to pngout? Here are the parameters it uses https://github.com/madskristensen/ImageOptimizer/blob/master/src/Resources/Tools/png.cmd
Yes. The /k parameter allows you to specify chunk names to keep. So we need to figure out what the default set is and add the pHYs to that in the comma-delimited list.
With or without the /kpHYs
parameter I can't repro. It keeps the image DPI intact
Very very strange... Looking at the output of the command file:
pngout C:\temp\output.png C:\temp\output.png /s1 /y /v Name Offset Length CRC Required chunk: IHDR 00000010 0000000d b84f2787 Remove chunk: pHYs 00000029 00000009 78a53f76 Remove chunk: tEXt 0000003e 00000019 71c9653c Required chunk: IDAT 00000063 00046648 6ecb33da Required chunk: IEND 000466b7 00000000 ae426082
Yep, it was a caching issue on my end. This seems to work great
pngout is run with parameters that strip the pHYs chunk that declares the image's resolution. This causes behavioral changes for images at non-default resolutions (e.g. 300dpi "Retina" images).
This is a common bug in image optimizer tools; e.g. https://github.com/google/zopfli/issues/43