[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

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?"
0
ZuZuPetals
Asked:
ZuZuPetals
  • 2
1 Solution
 
BillDLCommented:
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!
)
pause

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?

Bill
0
 
BillDLCommented:
Thank you ZuZuPetals.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now