[SOLVED] Magick++ Identify (metadata struggle)

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
jakubrojek
Posts: 2
Joined: 2017-09-21T06:52:24-07:00
Authentication code: 1151

[SOLVED] Magick++ Identify (metadata struggle)

Post by jakubrojek »

I'm trying to use Magick++ in my software and i've been wondering if there is some method reflecting the 'magick identify -verbose image.tif' output?
I'm digging deeper and deeper and i cannot find relevant API, so i've been thinking about adding it to Magick++ myself.
Would it be much effort for you to point me to some place in code where i could start?
identify.c looks quite complex...

cheers, Jakub Rojek
Last edited by jakubrojek on 2017-09-21T07:52:13-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Magick++ Identify (metadata struggle)

Post by snibgo »

Set the verbose flag, and write the image to "info:".
snibgo's IM pages: im.snibgo.com
jakubrojek
Posts: 2
Joined: 2017-09-21T06:52:24-07:00
Authentication code: 1151

Re: Magick++ Identify (metadata struggle)

Post by jakubrojek »

wow! that's indeed 'magick' :O
Okaay, to elaborate more on that, if we want to redirect that to a Magick::Blob, we do:

Magick::Blob blob;
image.fileName("info:");
image.write(&blob);

and now we have all image info in blob. If we want to have that formatted in JSON, we set fileName to "json:"

THANK YOU!!
Post Reply