Page 1 of 1

Support for EXIF

Posted: 2007-07-28T10:39:06-07:00
by eastern_strider
Does Magick++ allow to read/write exif headers (and query individual exif tags such as exposure time) for JPEG and TIF files?

Thanks,
eastern_strider

Re: Support for EXIF

Posted: 2007-07-28T12:47:34-07:00
by magick
Get EXIF tags with image.attribute("exif:tag") where tag is the EXIF tag you are interested in..

Re: Support for EXIF

Posted: 2008-02-29T08:18:29-07:00
by mtrierscheid
Hello,
I'm currently trying to write exif-information into png and tiff images using Magick++.
I managed to write attributes into a tiff image and to read them out, using "display". I can write into the fields "Model", "Copyright" and "Artist". Can I also use custom fields? If yes, can I read them out without using the ImageMagick GUI or other tools?
And how can I write exif tags to and read them from png-images?
I'm new to Exif and ImageMagick.

Thanks!
Marina

Re: Support for EXIF

Posted: 2008-02-29T08:27:58-07:00
by magick
ImageMagick treats EXIF as a blob. It does parse the properties but there is no mechanism to update any field other than resolution. You will need to parse/update the blob yourself or use some other program to update the EXIF properties.

Re: Support for EXIF

Posted: 2008-03-02T15:40:28-07:00
by mtrierscheid
Thanks for the quick answer!
Could you please describe that a little bit more in detail? What would I have to do if I wanted to create a new field like "IntegrationTime"?
I added this field by

Code: Select all

image.attribute("IntegrationTime", "10000");
Or should it be

Code: Select all

image.attribute("exif:IntegrationTime", "10000");
?
Before writing the image to a file I can read this attribute out again by calling

Code: Select all

std::cout<<image.attribute("IntegrationTime"); 
That's fine. But when I read the image from this file the attribute has "gone", the attribute-method returns an empty string.

So, what can I do?
Thanks in advance!

Re: Support for EXIF

Posted: 2008-03-02T16:31:35-07:00
by magick
ImageMagick does not update the EXIF blob other than the image resolution and the image orientation fields. You are responsible for parsing an EXIF blob and updating any fields you require. There are plenty of EXIF utilities that you can use to accomplish this. If you want to use Magick++ you would need to extract the EXIF profile as a blob, update it, and inject it back with the exifProfile() method.