Search code examples
matlabxmp

XMP toolbox for Matlab


Has anyone ever heard of something that might facilitate the work with XMP metadata in Matlab?

For instance, EXIF metadata can be read simply by using the exifread command -

output = exifread(filename);

I've found this thread, but it seems to be dead.


Currently I am thinking about the following options:

  1. Writing MEX file using C++ XMP SDK
  2. Calling Java routines using JAVA XMP SDK

To summarize, the question is: Do you have any idea on how XMP can be read/written in Matlab?


Solution

  • I have found the answer. The best way is to download ExifTool and any Matlab JSON parser. It is possible to extract it from any file format, including .DNG, .XMP, .JPEG, .TIFF.

    Step 1: Extract the info into temporary JSON file by using

    system(['exiftool -struct -j ' fileName '>'  tempFile]);
    

    Step 2: Call the JSON parser on the tempFile
    Step 3: You have the data in Matlab struct.