Specifying quality changes PNG file format to ISO Media
Closed this issue · 4 comments
kbrandwijk commented
Using sharp-cli@2.1.0:
❯ file logo.png
logo.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
❯ npx sharp-cli -i ./logo.png -o ./logo_opt.png
/.../logo_opt.png
❯ file logo_opt.png
logo_opt.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
❯ file logo_opt.png
logo_opt.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
❯ npx sharp-cli -i ./logo.png -o ./logo_opt80.png --quality 80
/.../logo_opt80.png
❯ file logo_opt80.png
logo_opt80.png: ISO Media
kbrandwijk commented
Additionally, I tried specifying --format input
explicitly, which didn't help. Specifying --format png
did, but that's not a solution for us (expo-optimize
) because we encounter different input formats.
vseventer commented
Thanks for reporting - this looks like a bug where I forgot to add force: false
to HEIF meaning this is actually quite a big problem.
vseventer commented
@kbrandwijk This has now been released as v2.1.1.
kbrandwijk commented
Awesome, I can confirm that fixes it!