ImageMagick: How set and display a comment in an image

I'm supposedly using this command to set a comment:
convert in.jpg -comment 'Permanent Waves' out.jpg

Yet I don't see the comment if this command is performed:
identify -verbose out.jpg

I'd like retrieve JUST the comment.  Does a command like this exist?
identify -comment out.jpg
which would output "Permanent Waves?"
Who is Participating?
Try this from the command prompt:

identify -verbose out.jpg | find /i "comment:"

If you just need the actual text of the comment without the "comment: " part in the line, then I'm sure we can come up with something to suit if this batch file isn't any use to you. (I'll explain it if you need).

@echo off
SetLocal EnableDelayedExpansion
for /f "tokens=2 delims=:" %%A in ('identify -verbose in.jpg ^| find /i "comment:"') do (
    set Comment=%%A
    echo !Comment:~1!

Perhaps it might be wise to ascertain a couple of details about how you are calling the processes and how you intend using the retrieved comment.

- What is your operating system?
- Are you running a "DOS" batch file containing your commands?
- If NO to the above, COULD you make use of a batch file to do what you need?

Thank you ZuZuPetals.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.