I am trying to write a program to embed data into specimens images from a zoological database. I plan to do this using the MetaInformation option for Image. For some reason I cannot understand the MetaInformation for Exif is not exporting to the jpeg’s I am creating. The revelvant documentation can be found [here. My code is as follows:
The second paragraph and fourth and fifth sub-paragraphs under Elements at ref/format/JPEG indicate that Exif is currently supported only by Import, not by Export.
I thought that too, that they just don’t support exporting EXIF data. But then I read “The embedded Exif tags are automatically exported when exporting as JPEG.” and it made me think that they do export EXIF data.
I gave this problem a go, but had no luck. I even downloaded a jpeg with lots of EXIF data from the web and imported it into MMA, but could not get it to export it with the EXIF data.
The wording of that paragraph does seem a little odd in light of this behavior:
In[2]:= test =
Import["http://www.exif.org/samples/canon-ixus.jpg",
"ImageWithExif"];
test // Head
Out[3]= Image
In[4]:= "Exif" /. (MetaInformation /.
Options[test, MetaInformation]) // Length
Out[4]= 41
In[5]:= Export["test.jpg", test, "ImageWithExif"]
During evaluation of In[5]:= Export::inselem: There are insufficient elements to export to JPEG format. >>
Out[5]= $Failed
I asked around and was told that “ImageWithExif” is definitely not supported for Export with JPEG, so the example I gave above was misleading. On the other hand, I was informed that it should actually work as specified in the paragraph Jason noted:
‘For the “ImageWithExif” element, the Exif tags are embedded using the MetaInformation option of the imported Image object under the name “Exif”. The embedded Exif tags are automatically exported when exporting as JPEG.’
However, this currently isn’t the case (in my 9.0.1 on Windows):
Thank you for clarifying this matter. The sentence “The embedded Exif tags are automatically exported when exporting as JPEG.” was causing me confusion as the documentation seemed to be contradicting itself. I already submitted a support request on this matter. Please let me know when you know something.