4

I am writing an application which read/write metadata for an image (it converts a raw file into a jpeg/tiff) and I need to write metadata about camera/mode/...into the generated jpeg.

I know that I can do this using exif and in windows I am using GDI to do this. But I am reading information about xmp and xmp sdk from adobe.

I am wondering which one should I use? exif or xmp?

How they are relates to each other?

Why one may select to write exif metadata and somebody else may select XMP? What is the pros/cons of selecting any of them.

I am writing in c++ on windows (visual studio 2012)

mans
  • 17,104
  • 45
  • 172
  • 321

2 Answers2

1

If you are writing JPEG or TIFF formats, I think you should stick with Exif.

All TIFF format readers will be able to parse Exif, as Exif is a subset of TIFF (a sub-IFD with special Exif-defined tags). Most "JPEG" readers also know how to parse Exif/TIFF.

Now, you could of course add XMP to the file as well, but I suggest you do this in addition to plain Exif, and only if you really need it.

XMP does allow richer metadata. But as the metadata you have got is from a camera RAW file, I would think they map directly to Exif tags, given Exif was developed by the digital camera industry for exactly the use you describe.

So, basically: Go with Exif because it has better tool support. Add XMP only if you need it, for richer metadata.

Harald K
  • 26,314
  • 7
  • 65
  • 111
1

XMP does indeed map values to exif tags.
Both EXIF and XMP are rich sources of image metadata.
The benefit of XMP is that it is easily readable and any XMP-aware application (like all Adobe products) can manipulate these properties.

XMP derives the values from the native values in the image, so basically XMP provides a mapping between properties in the exif block in images and reconciles these values in the XMP namespaces as defined in the ADOBE XMP SDK documentation.
The benefit of using the XMP SDK to manipulate metadata is that then the responsibility of reconciling between different image metadata formats (Like exif, IPTC or XMP) while reading or writing is transferred to the XMP SDK.

If any change is made to the XMP property, it is reflected back to the exif block in image. Similarly if any non-XMP aware application has modified the exif metadata without modifying the corresponding xmp value, at the time of read operation, the XMP SDK will reconcile this change into the XMP value and while writing, this change will be saved back.

Using the XMP SDK is to manipulate metadata is basically easier as you can leave a lot of format specific detailing upto the SDK to handle.

More information on different sources of image metadata is available on the Metadata Working Group.

The complete Spec can be downloaded from here.

Scott Solmer
  • 3,871
  • 6
  • 44
  • 72