PNG comments commands
Posted: 2019-05-21T07:57:33-07:00
In past versions of IM, I was able to do this command:
and it would save out the contents of the comments for image.png into comments.txt
It seems that this command no longer works in the current version of IM (ImageMagick 6.9.10-11 Q16 x86_64 2018-09-08)
Am I doing something wrong or has the syntax slightly changed for the above command?
Searching through forums here and elsewhere, I found this newer command:
which does work and outputs the comments which I think fixes my needs to read out the comments.
I need to save out the comments of a PNG file, make a minor edit to the comments, and then save the new comments into a new version of the PNG file.
Again, in the past versions of IM, I used this command to copy back the comments:
This unfortunately gives me errors... that look similar to this:
The first line of my comments.txt file is this:
"Molecular Dynamics Areamap file version 1.7, run with Areafill"
and it looks like it is parsing each individual word and spewing out these errors. This used to work with no errors in previous versions of IM.
I have also tried this:
which also outputs the same errors as above.
I thought perhaps that my comments.txt file was somehow screwy, so I did a dos2unix to make sure the EOL were correct, but that did not resolve it either.
Any help is greatly appreciated.
Chris
Austin, TX
Code: Select all
identify -format %c image.png > comments.txt
It seems that this command no longer works in the current version of IM (ImageMagick 6.9.10-11 Q16 x86_64 2018-09-08)
Am I doing something wrong or has the syntax slightly changed for the above command?
Searching through forums here and elsewhere, I found this newer command:
Code: Select all
convert image.png -format "%c" info: > comments.txt
I need to save out the comments of a PNG file, make a minor edit to the comments, and then save the new comments into a new version of the PNG file.
Again, in the past versions of IM, I used this command to copy back the comments:
Code: Select all
convert -comment @comments.txt original.png new.png
Code: Select all
convert: unable to open image `Dynamics: No such file or directory @ error/blob.c/OpenBlob/2873.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
convert: unable to open image `Areamap': No such file or directory @ error/blob.c/OpenBlob/2873.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
convert: unable to open image `file': No such file or directory @ error/blob.c/OpenBlob/2873.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
convert: unable to open image `version': No such file or directory @ error/blob.c/OpenBlob/2873.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
... it goes on for a long list showing each word in the text file...
"Molecular Dynamics Areamap file version 1.7, run with Areafill"
and it looks like it is parsing each individual word and spewing out these errors. This used to work with no errors in previous versions of IM.
I have also tried this:
Code: Select all
convert -set comment @comments.txt image.png
I thought perhaps that my comments.txt file was somehow screwy, so I did a dos2unix to make sure the EOL were correct, but that did not resolve it either.
Any help is greatly appreciated.
Chris
Austin, TX