Search code examples
c++exifxmpexiftool

why I am getting this warning when I try to add xmp to a jpeg using libjpeg


I am trying to convert a code that write exif into a jpeg image. The original code was this:

jpeg_write_marker(&cinfo, 0xe1, (unsigned char *)&ex, exifsize);

where the ex is a block of memory that exif data was written into it and exifsize if the size of that block.

To add the xmp to it, I created a sample xmp block (using samples that I found here: (https://developers.google.com/photo-sphere/metadata/?hl=en) and try to add it to the jpeg file using this code:

jpeg_write_marker(&cinfo, 0xe1, xmpBlock.getData(), xmpBlock.getdataSize());

the code works and I can see both xmp and exif tags using exif viewer (http://regex.info/exif.cgi) but the site also give me a warning:

 ExifTool
 Warning    ExifIFD pointer references previous ExifIFD directory

what is the meaning of this warning and how I can fix it?


Solution

  • What the warning means is that the exif data is written improperly and not to the exif specification. Try backtracking to see where the data is getting corrupted or even if exif block is being created properly in memory.