Magick++: Get image attributes

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
olear
Posts: 58
Joined: 2015-05-24T10:56:42-07:00
Authentication code: 6789

Magick++: Get image attributes

Post by olear » 2015-06-29T16:17:00-07:00

Hi, I need to get some image info from a PSD. I have tested 'identify' and the data I need is present, but how can I get this info using Magick++?

I know about the attribute() function, but the info I need is empty, or I don't know the right attribute "command".

Example:

Code: Select all

image.read("somefile.psd[some layer]"); // also tried without layer
std::cout << image.attribute("tiff:XResolution") << std::endl; // ok
std::cout << image.attribute("tiff:YResolution") << std::endl; // ok
std::cout << image.attribute("psd:layer.opacity") << std::endl; // empty
std::cout << image.attribute("psd:layer.x") << std::endl; // empty
std::cout << image.attribute("psd:layer.y") << std::endl; // empty
Output is:

Code: Select all

300
300

Output from identify:

Code: Select all

    tiff:XResolution: 300
    tiff:YResolution: 300
    psd:layer.opacity: 2408550287
    psd:layer.x: 61
    psd:layer.y: 33
The tiff stuff works, but not the rest. I also need to get the 'Scene:' and 'Compose:' attribute, but don't know the "command" for that.

Sorry if this is a stupid question :)

Post Reply