Not all values are being written to .tif file

Started by droesler, March 22, 2023, 01:04:26 PM

Previous topic - Next topic

droesler

Image::ExifTool v. 12.30

I'm writing a number of tags into .tif files, but not all tags are being written.  In particular the Description and Title tags.  Tags such as City, State, Keywords, HierarchicalSubject are being written.

After setting the values with $exifTool->SetNewValue( 'Tag', $value ) and checking with $exifTool->GetNewValue( 'Tag' ) the new value is there.  $exifTool->WriteInfo( FILE ) returns 1.

If I look in the image file directly a Description (Lightroom Caption field) value is in dc:description.  If I try to use that ExifTool says it is not a valid field.

I have used similar scripts on 100's of other .tif files with no issue and can not figure out what is different this time :-(

From the command line exiftool -validate FILE returns the following but doesn't list the warnings.
Validate                        : 6 Warnings (5 minor)
Dennis

droesler

They say it is bad form to reply to your own post, but...

If I use XMP:Title and XMP:Description then the those fields are updated.  I went back and looked at previous scripts and didn't need to specify the namespace.  Not sure what has changed.

Now my issue is with Lightroom because it doesn't seem to import those fields when I select Metadata->Read Metadata from file.

Phil Harvey

To list the warnings use exiftool -validate -warning -a FILE

You shouldn't need to specify the XMP group when writing Title or Description because this is the default group for these tags for a .TIF file.  Use the exiftool app to read back these tags to see what happened:

exiftool -a -G1 -title -description FILE

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

StarGeek

Quote from: droesler on March 22, 2023, 01:04:26 PMIf I look in the image file directly a Description (Lightroom Caption field) value is in dc:description.  If I try to use that ExifTool says it is not a valid field.

The full name would be XMP-dc:Description, as it is part of the Dublin Core group.

But as Phil says, Description should be enough.  IMO, best practice when writing tags is not to use a specific group unless required, instead just using the main group name, e.g. XMP:Description/IPTC:Caption-Abstract/EXIF:ImageDescription, when you can't  just write the tag names, as would be the case with IPTC:City/XMP:City.  EXIF in particular is susceptible to writing incorrect groups, as the group names are a bit unclear, e.g. ExifIFD/SubIFD/IFD0
"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

droesler

The output from validate is

Validate                        : 4 Warnings (3 minor)
Warning                         : [minor] Non-standard IFD0 tag 0x935c ImageSourceData
Warning                         : Missing required TIFF ExifIFD tag 0xa000 FlashpixVersion
Warning                         : [minor] ExifIFD tag 0xa002 ExifImageWidth is not allowed in TIFF
Warning                         : [minor] ExifIFD tag 0xa003 ExifImageHeight is not allowed in TIFF

I did get Lr to import Caption by using
$exifTool->SetNewValue( 'IPTC:Caption-Abstract', $caption );which is surprising. 

I agree with StarGeek to not use a group unless necessary.  I have used just Description and Title in scripts for quite awhile.  I looked at a script I used last year processing several hundred images and found this.
$exifTool->SetNewValue('Description', $caption);   # Don't use Caption, that is mapped to the acdsee namespace and Lightroom doesn't read it.  So here I was just using Description and everything worked as expected.

I also found a thread from 2020 I had posted and I believe it was Phil that said that Description and Title should always be placed in XMP, EXIF and IPTC groups.  That lead me to look what tags were in EXIF and IPTC that would correlate to Description.

If I use XMP-dc:Title then the data is written to the file.  But Lightroom won't import it.  I know that this worked previously.  I can only presume something has changed with Lightrooms Read Metadata from file.

Thanks for the feedback.

StarGeek

Quote from: droesler on March 22, 2023, 10:51:50 PMIf I use XMP-dc:Title then the data is written to the file.  But Lightroom won't import it.  I know that this worked previously.  I can only presume something has changed with Lightrooms Read Metadata from file.

I'd guess that the IPTCDigest is what the problem is. The hash no longer matches the data. If you know the IPTC and XMP data are properly synced, you can use
exiftool -IPTCDigest=new /path/to/files/

Alternatively, remove it and let Lightroom fix it
exiftool -IPTCDigest= /path/to/files/

If you plan on continuing to edit the metadata outside of LR, then, IMO, ditch IPTC altogether.  You have to make sure that the IPTC and XMP tags are properly sync and update the IPTCDigest every time.  More work for no real reward unless you use a program that reads just IPTC and not XMP (*cough*Irfanview*cough*)

My longer opinion can be found in this post.
"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