Author Topic: iPhone 16 photo and its Phantom Metadata  (Read 620 times)

Offline Gary D.

  • Newcomer
  • *
  • Posts: 44
    • View Profile
iPhone 16 photo and its Phantom Metadata
« on: October 27, 2024, 10:55:21 AM »
Metadata added by PM6+ to an iphone16 Pro exported image is not visible from other applications.

In a nutshell I take a picture with iPhone 16 pro, using the Apple camera app. 
Export the image,  add metadata to the image using PM6+ 
When I edit that image using Lightroom Classic. The metadata is missing.
If I add metadata using the Apple photo app ( Title,Caption, Keywords) before export, that data does not appear when I open in PM6+.
When I add my metadata using PM6, and edit that image in LRC,  The metadata added from the apple photos app is shown.

If I export unmodified originals from the Apple Photos App, add metadata with PM6, then edit in LRC the PM6 Metadata appears, as usual.
When  I ‘Get Info’ from the MacOS Finder it  does not display the PM6 metadata for those Apple exported image. (Exported Unmodified Originals work normally)

When I use the LRC camera app or the Hailid camera app with  0 Process option, the metadata is displayed and updated normally. If I use Halid Camer with the Apple processing the metadata is abnormal
When I use exiftool to dump the metadata the PM6 data is displayed
 I did notice that images from the new phone has got a lot of new metadata fields added to the files.   And Apple has changed the definition of “Unmodified Original” since those files reflect image options ( styles, crop …) that were set at time of capture.

I did not see this behavior with my iPhone14 on IOS18.  And the “Pre” subscription PM6 wouldn’t even recognize the iPhone 16 images.


Here’s my setup


PM6 2024.8, build 7765
iMac M1
MacOS 18.0.1
LRClassic 14.9.1
Camera Raw 17.0


And I’ve attached 4 sample files

IMG_2684.heic.  exported from Photos app before PM6 edits
IMG_2684PM6.heic. exported from Photos app after PMR edits.. This is what I edit in LRC.  And it didn’t matter how I gat the image into LRC
IMG_2684UnMod.HEIC Exported from Photos app as Unmodified Original before PM6 edits
IMG_2684UnModPM6.HEIC Exported from Photos app as Unmodified Original after  PM6 edit

IMG_2684.heic. XML data from exiftool -G
Before PM6

[XMP]           XMP Toolkit                     : XMP Core 6.0.0
[XMP]           Date Created                    : 2024:10:27 09:54:47-04:00
[XMP]           Creator Tool                    : 18.0.1
[XMP]           Title                           : APPLETITLE
[XMP]           Description                     : AppleCaption
[XMP]           Subject                         : AppleKey
[XMP]           HDR Gain Map Version            : 131072
[XMP]           HDR Gain Map Headroom           : 4.947298

IMG_2684PM6.heic XML data from exiftool -G
After PM6
[XMP]           Creator Tool                    : 18.0.1
[XMP]           HDR Gain Map Version            : 131072
[XMP]           HDR Gain Map Headroom           : 4.947298
[XMP]           XMP Toolkit                     : XMP Core 5.6.0
[XMP]           Date Created                    : 2024:10:27 09:54:47-04:00
[XMP]           Rating                          : 0
[XMP]           Data Mining                     : Unspecified - no prohibition defined
[XMP]           Color Class                     : 0 (None)
[XMP]           Tagged                          : No
[XMP]           Prefs                           : Tagged:0, ColorClass:0, Rating:0, FrameNum:002684
[XMP]           PM Version                      : 2024.8.7765
[XMP]           Image Number                    : 2684
[XMP]           Subject                         : PM6KeyWord
[XMP]           Description                     : PM6Description
[XMP]           Title                           : PM6Title

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 469
    • View Profile
    • Camera Bits, Inc.
Re: iPhone 16 photo and its Phantom Metadata
« Reply #1 on: November 01, 2024, 01:28:01 PM »
Gary,

This is a bit complicated.

The iPhone writes out XMP for its HDR gain map (which BTW is not packetized as is required when embedding XMP).  This is not supposed to be "normal" XMP for storing IPTC type of data. This XMP is also not "tied" to the "main" image for HEIC (as you may be aware of there are multiple images in an HEIC file, but only one is the "main" image).

PM used to get tripped-up by this HDR XMP and update IPTC etc in there.  This was not correct.  So we fixed this a while back (last year?) to add a new XMP block and tie it to the main image (and of course packetize it). But since we had this previous bug, I made it so PM would at least try to retain any IPTC/XMP that was written by older versions in the HDR XMP, but it ignores the HDR gain map XMP.

So I think what is happening is that PM is picking up the XMP you added in Photos app, but this is also not tied to the main image, so PM doesn't update it, but it at least carries forward the APPLETITLE and AppleCaption and AppleKey values. It doesn't carry forward any HDR metadata. So now there are 3 XMP blocks.

The use of the "-G" option in exiftool is a red herring because it appears to group all 3 XMP blocks together.  For example, only the HDR XMP block has HDR XMP.

However you did find what may appear to be a "bug". When we added support for the Plus Data Mining field, this is a bit unusual because it has no "undefined" value. It has an "unspecified" setting. Our UI is a popup menu and this is default value if the original XMP has no data mining value. So when PM writes out the XMP, it adds the "unspecified" value. This isn't technically incorrect - you didn't specify your choice for data mining. We could potentially prevent PM from adding this in, but it isn't a "bad" thing, right? If you don't specify this, then AI engines can use your photos for training (for example).

I need to dig into how Apple is actually adding their XMP in Photos. It may be incorrectly not tied to the main image. And furthermore, it could be that LR classic also has a problem. But since Preview app on Mac doesn't show PM's metadata either, it could be that both LR and Preview have a "bug". The "bug" could be that they find all these XMP blocks, but only pay attention to the first one (written by Photos not HDR) and ignore any further XMP (that PM writes). I think PM will use the last XMP block by default (this can be changed in IPTC/XMP prefs). I don't know until I debug which I can't do right now.

In any case, this is the actual XMP that PM is writing out.

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.6.0">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:plus="http://ns.useplus.org/ldf/xmp/1.0/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:photomechanic="http://ns.camerabits.com/photomechanic/1.0/"
    xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
   photoshop:DateCreated="2024-10-27T09:54:47-04:00"
   xmp:CreateDate="2024-10-27T09:54:47-04:00"
   xmp:Rating="0"
   plus:DataMining="http://ns.useplus.org/ldf/vocab/DMI-UNSPECIFIED"
   exif:GPSLatitude="40,35.169N"
   exif:GPSLongitude="75,22.533W"
   exif:GPSAltitudeRef="0"
   exif:GPSAltitude="1461/10"
   photomechanic:ColorClass="0"
   photomechanic:Tagged="False"
   photomechanic:Prefs="0:0:0:002684"
   photomechanic:PMVersion="2024.8.7765"
   aux:ImageNumber="2684">
   <dc:subject>
    <rdf:Bag>
     <rdf:li>PM6KeyWord</rdf:li>
    </rdf:Bag>
   </dc:subject>
   <dc:description>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">PM6Description</rdf:li>
    </rdf:Alt>
   </dc:description>
   <dc:title>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">PM6Title</rdf:li>
    </rdf:Alt>
   </dc:title>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>

Hope that helps for now until I have time to do more digging...

--dennis

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 469
    • View Profile
    • Camera Bits, Inc.
Re: iPhone 16 photo and its Phantom Metadata
« Reply #2 on: November 04, 2024, 04:25:33 PM »
Gary,

Looks like there was a bug in PM which I have fixed.

PM made the assumption that an XMP block could only be associated with one image 'grid'. Photos app adds another image 'grid' and the XMP is associated with both of these. Because PM was expecting only a single image to be associated with the XMP, it created a new XMP block. This was not necessary.

I need to see how to make PM "fix" (i.e. patch) the errors it made by adding this extra XMP block. Further testing and updates is necessary.

Thanks for pointing this out.

Regards,

--dennis

Offline Gary D.

  • Newcomer
  • *
  • Posts: 44
    • View Profile
Re: iPhone 16 photo and its Phantom Metadata
« Reply #3 on: Today at 04:26:34 AM »
As always thanks Dennis and CamerBits team