I use JuicyPixels for PNG saving from my program, and ImageMagick to perform image processing. The PNG metadata survives convert test-good.png test-bad.png, but in a form that neither JuicyPixels nor pngmeta can see. exiftool sees it fine. I had a similar issue with my Kalles Fraktaler 2+ fork, in that case I was using libpng. The issue seems to be that the metadata is stored after the image data chunks in the PNG file, rather than before it (as pngmeta expects). It is also stored in a compressed text chunk instead of uncompressed. Some versions of ImageMagick and/or other software may also change the capitalization of the Comment text field name.
pngmeta 1.11 (built with libpng 1.6.34 and zlib 1.2.8)
libimage-exiftool-perl/stable,stable,now 11.16-1 all [installed,automatic]
ghc-8.6.5
JuicyPixels-3.3.3.1
I use JuicyPixels for PNG saving from my program, and ImageMagick to perform image processing. The PNG metadata survives
convert test-good.png test-bad.png
, but in a form that neither JuicyPixels norpngmeta
can see.exiftool
sees it fine. I had a similar issue with my Kalles Fraktaler 2+ fork, in that case I was usinglibpng
. The issue seems to be that the metadata is stored after the image data chunks in the PNG file, rather than before it (aspngmeta
expects). It is also stored in a compressed text chunk instead of uncompressed. Some versions of ImageMagick and/or other software may also change the capitalization of theComment
text field name.I looked into the
pngmeta
source code, and for earlierlibpng
versions it had a way to read the later metadata by skipping the image chunks, but that is disabled for currentlibpng
. My workaround in KF2+ is poor: I simply decode the image data usinglibpng
and check again for metadata afterwards: https://code.mathr.co.uk/kalles-fraktaler-2/blob/3f345212aaf802eb3f688996bf6473b48590e46b:/fraktal_sft/png.cpp#l92I uploaded my images here: https://mathr.co.uk/tmp/JuicyPixels/test-good.png https://mathr.co.uk/tmp/JuicyPixels/test-bad.png
test-good.png
was saved by JuicyPixels, I then ranconvert test-good.png test-bad.png
.Hopefully JuicyPixels can implement a more sensible solution, I haven't looked into it yet.
Versions: