What is the relationship between exif and xmp? Are they interchangeable? - c++

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)

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.

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.

Related

How to get a windows file "author" not the owner using c++ with windows api

I found this link where it shows how to get the owner of the file but is there anyway we can also get the author of the file using windows api and C++?
author of the file
No such thing exists in Windows filesystems.
You might be confused by a descriptive metadata stored in some data formats, such as PDF, DOC, various image, audio and video formats.
Retrieving this metadata is obviously format-specific (there might be libraries for that).
Also, metadata is optional and not all the files contain it.

How to convert images like JPEG, PNG, etc. to WebP with ColdFusion while maintaining the metadata?

I'm looking for an effective method for automating the conversion of a number of images to the WebP image format. I'm particularly interested in a method that will keep the metadata or allow me to add or edit the metadata.
The easiest way would be <cfexecute> with cwebp https://developers.google.com/speed/webp/docs/precompiled
As for metadata...
WebP format do support EXIF/XMP metadata. The next version of WebP library (libwebp) will have appropriate APIs supporting handling of
EXIF/XMP metadata, along with supporting utility binaries to convert
JPEG/PNG to WebP format retaining the metadata from original files.
Quoted from WebP Google Group. Meanwhile, follow issue 52 for latest updates? https://code.google.com/p/webp/issues/detail?id=52

Store a file metadata in an extra file

I have a bunch of image files (mostly .jpg). I would like to store metadata about these files (e.g. dominant color, color distribution, maximum gradient flow field, interest points, ...). These data fields are not fixed and are not available in all images.
Right now I am storing the metadata for each file as a separate file with the same name but a different extension. The format is just text:
metadataFieldName1 metadataFieldValue1
metadataFieldName2 metadataFieldValue2
This gets me wondering, is there a better/easier way to store these metadata? I thought of ProtocolBuffer since I need to be able to read and write these information in both C++ and Python. But, how do I support the case where some metadata are not available?
I would suggest that you store such metadata within the image files themselves.
Most image formats support storing metadata. I think that .jpeg support it through Exif.
If you're on Windows you can use the WIC to store and retrieve metadata in a unified manner.
Why protocol buffers and not XML or INI files or whatever text-ish format? Just choose some format...
And what do you mean with "metadata not available"? It is up to your application to respond to such error situations...what has this to do with the format of the storage?
Look at http://www.yaml.org. YAML is less verbose than XML and more human friendly to read.
There are YAML libraries for both C++, Python and many other languages.
Example:
import yaml
data = { "field1" : "value1",
"field2" : "value2" }
serializedData = yaml.dump(data, default_flow_style=False)
open("datafile", "w").write(serializedData)
I thought long on this matter and went with ProtocolBuffer to store metadata for my images. For each image e.g. Image00012.jpg, I store the metadata in Image00012.jpg.pbmd. Once I have my .proto file setup, the Python class and C++ class got auto-generated. It works very well and require me to spend little time on parsing (clearly better than writing custom reader for YAML files).
RestRisiko brings up a good point about how I should handle metadata not available. The good thing about ProtocolBuffer is it supports optional/required fields. This solves my problem on this front.
The reason I think XML and INI are not good for this purpose is because many of my metadata are complex (color distribution, ...) and require a bit of storage customization. ProtocolBuffer allows me to nest proto declaration. Plus, the size of the metadata file and the parsing speed is clearly superior to my hand-roll XML reading/writing.

Exporting *.png sequence from *.fla with C++

I need an animation in my program. My designer draws animation in Flash and provides me with *.fla file. All I need is to grab 30-40 PNGs from this file and store them within my internal storage.
Is it possible grab resources from *.fla with C++ ? Probably, some Adobe OLE objects can help?
Please, advice.
Thanks in advance.
If I asked an artist to make me an icon I wouldn't expect to need to write code to convert a .3DS model into a usable icon format.
You can save yourself a lot of time and hassle by having your designer use File->Export and give you PNGs of the layers and frames instead of a .FLA file if that's the format you require for your implementation.
If that's not possible for some reason then you can probably find a flash decompiler that has a command line option which you could launch from your program to extract assets as part of your loading sequence but that is generally frowned upon because this is not the intended use of the proprietary format for .swf/.fla anymore than you should design applications to extract source code from a binary executable.
Assuming
You are using CS5
The assets used internally in the FLA are already PNG's as you want them to be.
Then simply get the FLA saved as a XFL file, and you will be able to grab them from the library folder ( but then why not just get them to mail you the pngs ? )
So if for some reason you can only get access to the fla and not the designer, then you can do it programatically by renaming the fla to .zip, extracting.. and you have the XFL format.

How to modify EXIF metadata for JPEG images using Coldfusion?

I am using Coldfusion to view images stored in the file system and I can READ the EXIF metadata of JPEGs, but I'd like to know if it is possible to modify this information and re-save the image.
I know that there are XMP and IPTC custom tags out there, I googled now and seems that javaloader.cfc + some java lib are your only sure option.
EDIT: Since I work on stock photography application I got interested and found this command line tool which could do the trick:
http://www.sno.phy.queensu.ca/~phil/exiftool/