Can't seem to update comment field in Google Pixel Phone Images

Started by mjurgens, February 17, 2021, 08:25:12 PM

Previous topic - Next topic


I've successfully been updating the comment field in many images until I tried in an image from a Google Pixel phone.
Here's a sample image:

This is successful:
my $success=$exifTool->SetNewValue('UserComment', $comment,Replace=>1);

This is not successful:
$success = $exifTool->WriteInfo($file);

A check of the file using the command line tool shows that no comment has been written

Strangely, using the command line tool (even at v12.16), this works:
exiftool -comment="1" /s/TEMP/PXL_20210205_230623035.jpg

I was using v12.16 and so I tried v12.18 but same result.

Is this a bug?


UserComment and Comment are two completely different tags.  The first is part of the EXIF block.  The second is the jpeg comment field, specific to jpegs only.

I tried setting the UserComment on your example image on the command line with this command
exiftool -P -overwrite_original -usercomment=test Y:\!temp\ccccc\o\PXL_20210205_230623035.jpg
and it came back with this error
Error: [minor] Incomplete extended XMP (GUID 7504876AC6DC4F17F78267AF27559BED)
* 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).

Phil Harvey

StarGeek posted while I was composing, but here it is anyway...

Writing Comment works.  Writing UserComment doesn't.  This is because there is a problem with the XMP and UserComment also exists in XMP.

> exiftool PXL_20210205_230623035.jpg -usercomment=test
Error: [minor] Incomplete extended XMP (GUID 7504876AC6DC4F17F78267AF27559BED) - a.jpg
    0 image files updated
    1 files weren't updated due to errors

To write this, either specify EXIF:UserComment, or use the API IgnoreMinorErrors option.

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


Great help and so quickly.
My fault for getting the fields mixed up.

I have used the following for now and it works.

%Image::ExifTool::UserDefined::Options = (
    IgnoreMinorErrors=> 1,