ImageMagick: How set and display a comment in an image

Posted on 2011-05-04
Last Modified: 2013-11-19
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?"
Question by:ZuZuPetals
    LVL 38

    Accepted Solution

    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?

    LVL 38

    Expert Comment

    Thank you ZuZuPetals.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I. Introduction In a previous article ( (now deprecated), I discussed how to upgrad…
    I. Introduction In a previous article ( (now deprecated), I discussed how to upgrad…
    Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now