XMP (and other?) metadata that maps to EXIF

Started by eeeps, July 08, 2021, 05:22:43 PM

Previous topic - Next topic

eeeps

The HTML spec just landed a change, telling browsers to take EXIF resolution information into account when assigning images' intrinsic size.

https://github.com/whatwg/html/pull/5574

The spec currently tells browsers to look strictly at *binary* EXIF information; we are trying to figure out how to test this.

I know that XMP also defines fields which map to EXIF fields. I have two questions:

1. Is there a way to create an image with XMP fields which map to EXIF's `ResolutionUnit`, `XResolution`, `YResolution`, `PixelXDimension`, and `PixelYDimension`, without having the corresponding binary EXIF data, also?
2. Are there other metadata formats which contain fields that map to these EXIF fields?

Thank you!

StarGeek

Quote from: eeeps on July 08, 2021, 05:22:43 PM
1. Is there a way to create an image with XMP fields which map to EXIF's `ResolutionUnit`, `XResolution`, `YResolution`, `PixelXDimension`, and `PixelYDimension`, without having the corresponding binary EXIF data, also?

You can directly set the XMP-exif, XMP-exifEX and XMP-tiff tags without setting the EXIF tags at all. None of those tags are marked to avoid, so all you have to do is choose the tag name from those sections of the XMP tags page and prefix XMP:, e.g. -XMP:Orientation=Horizontal -XMP:ImageHeight=1200 -XMP:ImageWidth=1600.

Or if the EXIF tags are already set, use the exif2XMP.args file to copy all the EXIF data to the corrisponding XMP locations and remove the EXIF block
exiftool -EXIF:All= -tagsFromFile @ -@ exif2xmp.args /path/to/files/

Quote2. Are there other metadata formats which contain fields that map to these EXIF fields?

There are technically a few IPTC tags that correspond with EXIF tags, but not many.  Mostly the time related tags.  See the exif2iptc.args file for details.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

eeeps

This is exactly the information I needed, and works perfectly. Thank you!!!

(Extra credit question: is there any way to change the placement of the eXIf block when writing EXIF to PNGs? By default, it goes after IDAT using 12.16; per https://github.com/w3c/PNG-spec/issues/28 it would be great to get it in front.)

Phil Harvey

July 9, 2021 - Version 12.29
  - Changed PNG writer to add EXIF before IDAT


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

eeeps