How can I modify the Apple:ContentIdentifier in an iPhone photo?

Started by zhshen2004, October 17, 2024, 12:01:45 AM

Previous topic - Next topic

zhshen2004

Hi experts,

I read the thread where the Exiftool author mentioned how to update the "imageuniqueid" with a new GUID:

exiftool "-imageuniqueid<newguid" a.jpg
1 image files updated
exiftool -imageuniqueid a.jpg
Image Unique ID                 : 20180820-0723-2400-0BFE-E34C4BF98CD8

I have the following questions and would appreciate any suggestions:

1. How can I modify the Apple:ContentIdentifier in an iPhone photo?
   I tried and failed using this command:
   exiftool '-Apple:ContentIdentifier<"20180820-0723-2400-0BFE-E34C4BF98CD8"' IMG.jpg
2. Can I apply a new GUID to the ContentIdentifier in an iPhone photo?
   I tried and failed using this command:
   exiftool "-ContentIdentifier<newguid" IMG.jpg
Thank you for your assistance.


StarGeek

That tag is one of the Apple MakerNotes (see the Apple Tags page). MakerNotes cannot be created/deleted. They can only be edited/cleared if they already exist.

When you say you failed, what is the exact output from exiftool.

Have you checked to see if the tag already exists in the file?
exiftool -G1 -a -s -ContentIdentifier file.jpg
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

zhshen2004

Hi,

It seems like there is something wrong with the MakerNotes.
Are there any command options to show the status of the MakerNotes? Thanks.
exiftool -G1 -a -s IMG_20241016_155355.heic     
[ExifTool]      ExifToolVersion                 : 12.98
[ExifTool]      Warning                         : [minor] Bad format (16) for MakerNotes entry 14
[ExifTool]      Warning                         : [minor] Bad format (16) for MakerNotes entry 21
[System]        FileName                        : IMG_20241016_155355.heic
...

exiftool -G1 -a -s -ContentIdentifier IMG_20241016_155355.heic                                   
[Apple]         ContentIdentifier               : 2909445C-D2EF-48A6-B1DF-862CC76347DB
exiftool "-ContentIdentifier<newguid" IMG_20241016_155355.heic                               
Warning: [minor] Bad format (16) for MakerNotes entry 14 - IMG_20241016_155355.heic
Error: [minor] Maker notes could not be parsed - IMG_20241016_155355.heic
    0 image files updated
    1 files weren't updated due to errors

wywh

It seems it is possible to edit ContentIdentifier to a live photo a.jpg but not to a regular photo b.jpg where it does not exist:

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID .
======== ./a.jpg
[Apple]         ContentIdentifier               : A3E5437B-626A-42FE-9B6E-1791337877BF
[Apple]         ImageUniqueID                   : 8CDF4EB3-94DE-4116-8B26-7220A12AEAF5
======== ./b.jpg
[Apple]         ImageUniqueID                   : 88389A56-1E91-4441-83A5-3F38E561311D

exiftool -P -overwrite_original '-Apple:ContentIdentifier=12345678-1234-1234-1234-123456789012' '-Apple:ImageUniqueID=12345678-1234-1234-1234-123456789012' .
    1 directories scanned
    2 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID .                                                                                 
======== ./a.jpg
[Apple]         ContentIdentifier               : 12345678-1234-1234-1234-123456789012
[Apple]         ImageUniqueID                   : 12345678-1234-1234-1234-123456789012
======== ./b.jpg
[Apple]         ImageUniqueID                   : 12345678-1234-1234-1234-123456789012

It is possible to copy ContentIdentifier with Apple makernotes as a block to the regular photo b.jpg:

exiftool -P -overwrite_original -TagsFromFile a.jpg '-All:All<All:All' b.jpg                                                                                 
    1 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID .
======== ./a.jpg
[Apple]         ContentIdentifier               : 12345678-1234-1234-1234-123456789012
[Apple]         ImageUniqueID                   : 12345678-1234-1234-1234-123456789012
======== ./b.jpg
[Apple]         ContentIdentifier               : 12345678-1234-1234-1234-123456789012
[Apple]         ImageUniqueID                   : 12345678-1234-1234-1234-123456789012

ImageUniqueID seems to by default go also to ExifIFD group:

exiftool -P -overwrite_original '-ContentIdentifier=12345678-1234-1234-1234-123456789012' '-ImageUniqueID=12345678-1234-1234-1234-123456789012' b.jpg
    1 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID b.jpg                                                                     
[Apple]         ContentIdentifier               : 12345678-1234-1234-1234-123456789012
[Apple]         ImageUniqueID                   : 12345678-1234-1234-1234-123456789012
[ExifIFD]       ImageUniqueID                   : 12345678-1234-1234-1234-123456789012

Creating a new guid works like this in those images:

exiftool -P -overwrite_original '-Apple:ContentIdentifier=<newguid' '-Apple:ImageUniqueID<newguid' .
    1 directories scanned
    2 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID .                         
======== ./a.jpg
[Apple]         ContentIdentifier               : <newguid
[Apple]         ImageUniqueID                   : 20241017-0931-2301-7202-CFE2195D4200
======== ./b.jpg
[Apple]         ImageUniqueID                   : 20241017-0931-2300-7202-65F2BEE0D06D

It seems .heic accepts only block copies:

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID c.heic

exiftool -P -overwrite_original '-Apple:ContentIdentifier=12345678-1234-1234-1234-123456789012' '-Apple:ImageUniqueID=12345678-1234-1234-1234-123456789012' c.heic
    0 image files updated
    1 image files unchanged

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID c.heic                                                                                 

exiftool -P -overwrite_original -TagsFromFile a.jpg '-All:All<All:All' c.heic                                                                       
    1 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID c.heic
[Apple]         ContentIdentifier               : A3E5437B-626A-42FE-9B6E-1791337877BF
[Apple]         ImageUniqueID                   : 8CDF4EB3-94DE-4116-8B26-7220A12AEAF5

exiftool -P -overwrite_original '-Apple:ContentIdentifier=<newguid' '-Apple:ImageUniqueID<newguid' c.heic                                                       
    1 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID c.heic                         
[Apple]         ContentIdentifier               : <newguid
[Apple]         ImageUniqueID                   : 20241017-0941-3500-7248-3A52A87BEC32

exiftool -P -overwrite_original '-Apple:ContentIdentifier=12345678-1234-1234-1234-123456789012' '-Apple:ImageUniqueID=12345678-1234-1234-1234-123456789012' c.heic
    1 image files updated

exiftool -a -G1 -s -fileOrder5 FileName -ContentIdentifier -ImageUniqueID c.heic                                                                                 
[Apple]         ContentIdentifier               : 12345678-1234-1234-1234-123456789012
[Apple]         ImageUniqueID                   : 12345678-1234-1234-1234-123456789012

I hope this helps,

- Matti

Phil Harvey

Thanks Matti,

Quote from: wywh on October 17, 2024, 02:51:05 AMIt seems it is possible to edit ContentIdentifier to a live photo a.jpg but not to a regular photo b.jpg where it does not exist:

Correct.  MakerNote tags may not be created individually.

QuoteIt is possible to copy ContentIdentifier with Apple makernotes as a block to the regular photo b.jpg:

exiftool -P -overwrite_original -TagsFromFile a.jpg '-All:All<All:All' b.jpg

You don't need to copy -all:all.  Copying MakerNotes, Make and Model is sufficient (see FAQ 8).                                                                               
QuoteCreating a new guid works like this in those images:

exiftool -P -overwrite_original '-Apple:ContentIdentifier=<newguid' '-Apple:ImageUniqueID<newguid' .

The "=" is a typo, and shouldn't be there.

- 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 ($).

zhshen2004

Thank you for your precise answer; it's very clear and useful!

I have one more question. I noticed that when I try to copy the ContentIdentifier with Apple MakerNotes as a block to another photo using the following command:

Quoteexiftool -P -overwrite_original -TagsFromFile a.jpg '-All:All<All:All' b.jpg

This command overwrites the original useful EXIF information, such as camera details, date, and geolocation, etc. Is there an easy command or option to keep those data intact?

Phil Harvey

This is exactly why I said that you don't need to use -all:all in my last post.  See FAQ 8 as I mentioned.

- 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 ($).

wywh

Quote from: zhshen2004 on October 18, 2024, 01:02:26 AM
Quoteexiftool -P -overwrite_original -TagsFromFile a.jpg '-All:All<All:All' b.jpg
This command overwrites the original useful EXIF information, such as camera details, date, and geolocation, etc. Is there an easy command or option to keep those data intact?

Thanks to Phil I revised the command to copy only Apple MakerNotes and corrected that typo.

Live photo a.jpg and regular photo b.heic as an example:

exiftool -a -G0 -s -n -fileOrder5 FileName -ContentIdentifier -ImageUniqueID -ExifIFD:DateTimeOriginal -IFD0:Make -IFD0:Model -GPSPosition .     
======== ./a.jpg
[MakerNotes]    ContentIdentifier               : A3E5437B-626A-42FE-9B6E-1791337877BF
[MakerNotes]    ImageUniqueID                   : 8CDF4EB3-94DE-4116-8B26-7220A12AEAF5
[EXIF]          DateTimeOriginal                : 1988:06:01 12:00:00
[EXIF]          Make                            : Apple
[EXIF]          Model                           : iPhone SE (1st generation)
[Composite]     GPSPosition                     : -36.6101 -66.91515
======== ./b.heic
[EXIF]          DateTimeOriginal                : 2001:06:01 12:00:00
[EXIF]          Make                            : Apple
[EXIF]          Model                           : iPad Air (5th generation)
[Composite]     GPSPosition                     : 29.9792 31.1342

Copy just Apple MakerNotes as a block to the regular photo b.heic so other tags are intact:

exiftool -P -overwrite_original -TagsFromFile a.jpg '-MakerNotes<MakerNotes' b.heic                                                         
    1 image files updated

exiftool -a -G0 -s -n -fileOrder5 FileName -ContentIdentifier -ImageUniqueID -ExifIFD:DateTimeOriginal -IFD0:Make -IFD0:Model -GPSPosition .
======== ./a.jpg
[MakerNotes]    ContentIdentifier               : A3E5437B-626A-42FE-9B6E-1791337877BF
[MakerNotes]    ImageUniqueID                   : 8CDF4EB3-94DE-4116-8B26-7220A12AEAF5
[EXIF]          DateTimeOriginal                : 1988:06:01 12:00:00
[EXIF]          Make                            : Apple
[EXIF]          Model                           : iPhone SE (1st generation)
[Composite]     GPSPosition                     : -36.6101 -66.91515
======== ./b.heic
[MakerNotes]    ContentIdentifier               : A3E5437B-626A-42FE-9B6E-1791337877BF
[MakerNotes]    ImageUniqueID                   : 8CDF4EB3-94DE-4116-8B26-7220A12AEAF5
[EXIF]          DateTimeOriginal                : 2001:06:01 12:00:00
[EXIF]          Make                            : Apple
[EXIF]          Model                           : iPad Air (5th generation)
[Composite]     GPSPosition                     : 29.9792 31.1342

Creating a new guid works without the previous typo (I wonder how I could miss that ::) ):

exiftool -P -overwrite_original '-MakerNotes:ContentIdentifier<newguid' '-MakerNotes:ImageUniqueID<newguid' b.heic
    1 image files updated

exiftool -a -G0 -s -n -fileOrder5 FileName -ContentIdentifier -ImageUniqueID -ExifIFD:DateTimeOriginal -IFD0:Make -IFD0:Model -GPSPosition b.heic
[MakerNotes]    ContentIdentifier               : 20241018-1427-5200-96DD-3CC77501053A
[MakerNotes]    ImageUniqueID                   : 20241018-1427-5200-96DD-3CC77501053A
[EXIF]          DateTimeOriginal                : 2001:06:01 12:00:00
[EXIF]          Make                            : Apple
[EXIF]          Model                           : iPad Air (5th generation)
[Composite]     GPSPosition                     : 29.9792 31.1342

- Matti

stoffball

Quote from: wywh on October 18, 2024, 07:38:23 AMThanks to Phil I revised the command to copy only Apple MakerNotes and corrected that typo.

Copy just Apple MakerNotes as a block to the regular photo b.heic so other tags are intact:

exiftool -P -overwrite_original -TagsFromFile a.jpg '-MakerNotes<MakerNotes' b.heic                                                        
    1 image files updated
</snip>

This is FAQ 8: You can't copy the makernote block alone. You need to include the make and model tags.

exiftool -P -overwrite_original -TagsFromFile a.jpg -MakerNotes -make -model b.heic

Phil Harvey

I would say that you shouldn't copy it alone, not can't.

The problem is that the decoding of the MakerNotes often depends the value of Make and Model.  So if you don't copy these it may not be possible to properly read the maker notes.

- 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 ($).