Some EXIF Frustration with Downloaded Photos - Need Some Help...

Started by RRRichard, May 10, 2024, 03:22:48 AM

Previous topic - Next topic

RRRichard

I've been using Exiftool for a few years but I still feel like a 'newbie'...

My situation is this: I use the Google Chat application on both Windows 10 Pro and Android 14. I can download the same shared photos (jpg only) in both Windows and Android. When I use exiftool -s on the files, there is clearly a difference in the EXIF tags between the Windows dowloaded files and the Android downloaded files - so it seems Google is changing the EXIF data depending on the downloaded environment - and that seems to be related to my problem.

I put the downloaded files into a common folder (in Windows) named with the date format "yyyy-mm-dd" and I run the following command in the folder above the folder with the photos in it (in a command prompt window with admin rights):

exiftool -r -m -overwrite_original "-CreateDate<${directory;s/.*(\d{4})-(\d\d)-(\d\d).*/$1:$2:$3/} 12:00:00" .

None of the downloaded files have the CreateDate EXIF tag. Consistently, the files downloaded through Android have the CreateDate tag created and populated from the folder name date with no problem (whew!). But the files downloaded through Windows either do not have the tag created ("No writable tags set from" message) or the CreateDate tag is created but with an impossible/corrupt date value. I don't understand what is happening with the files downloaded in Windows. Anyone have any ideas?

The ultimate goal is to have all the date EXIF tags in all my photo files with the date represented by the folder name the files are in. Then I can upload them into Google Photos and have them properly displayed in date order. I start off with the CreateDate tag and then do the others... I read somewhere that without the CreateDate tag then I will get a "No writable tags set from" error when trying to change the other date tags. My photo collection has camera and scanned photos but the date needs to be the activity date of the photo. Having my collection organized like this also allows me to re-upload everything to Google Photos when it gets "messed up" (and it has). I have no idea what Google uses to sort the photos by date so I change all the EXIF dates.

Hoping someone might be able to throw some sand in my wheels to move forward on this... thanks.

StarGeek

Quote from: RRRichard on May 10, 2024, 03:22:48 AMNone of the downloaded files have the CreateDate EXIF tag. Consistently, the files downloaded through Android have the CreateDate tag created and populated from the folder name date with no problem (whew!). But the files downloaded through Windows either do not have the tag created ("No writable tags set from" message) or the CreateDate tag is created but with an impossible/corrupt date value. I don't understand what is happening with the files downloaded in Windows. Anyone have any ideas?

The app is probably rewriting the images and this is stripping away the metadata, though it seems weird to me that it either isn't doing so or is re-adding the data on Android.  Usually, it's the mobile platform that doesn't have the data.

QuoteI read somewhere that without the CreateDate tag then I will get a "No writable tags set from" error when trying to change the other date tags.

That would only happen if you try to copy from CreateDate when it doesn't already exist.

But I would recommend that in your command above, write to AllDates instead of CreateDate to skip the extra step.  AllDates is a shortcut for the three most common EXIF timestamps, CreateDate, DateTimeOriginal, and ModifyDate.

QuoteI have no idea what Google uses to sort the photos by date so I change all the EXIF dates.

Google will read quite a few date/time tags in a file.  I think it was about a dozen different ones last time I checked.  But if you write the AllDates shortcut, you will be covered for jpegs at least. I'm not sure about PNGs, though. PNG metadata support is uncommon among a lot of programs but I think Google supports it.
* 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).

RRRichard

Thank you for your reply and info StarGeek!

I was originally using the AllDates tag when I discovered the date corruption. So then I broke it out into commands using the 3 separate date tags (thinking maybe it was an issue with the AllDates tag itself). That's how I identified the problem with the CreateDate tag. I suspect if I can determine how to fix the CreateDate tag then AllDates would probably work fine too.

It appears I'm having two issues:

1. Why isn't a CreateDate tag added for some files?
2. How is the CreateDate tag populated with invalid data if the tag is added?

All the jpg files display identically and they appear to be editable in different editing programs - just some EXIF issues with the files downloaded through Chrome in Windows. I'll see if downloading using Edge makes a difference.

StarGeek

Quote from: RRRichard on May 10, 2024, 01:23:54 PMIt appears I'm having two issues:

1. Why isn't a CreateDate tag added for some files?

What is the exact output from exiftool?  Are you checking to see if CreateDate has been created with exiftool or are you using some other program?  Use the command in FAQ #3 to see all the data and their locations.

Quote2. How is the CreateDate tag populated with invalid data if the tag is added?

Can you give an example?

It feels like you're leaving some details out.

* 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).

RRRichard

StarGeek... I will re-run the list using the FAQ command...

RRRichard

#5
Just learned a new Exiftool command today... thank you StarGeek...  :)

Tag list for corrupted CreateDate tag:

[ExifTool]      ExifToolVersion                 : 12.84
[System]        FileName                        : one-edge.jpg
[System]        Directory                       : .
[System]        FileSize                        : 314 kB
[System]        FileModifyDate                  : 2024:05:10 11:51:44-06:00
[System]        FileAccessDate                  : 2024:05:10 12:00:41-06:00
[System]        FileCreateDate                  : 2024:05:10 11:33:33-06:00
[System]        FilePermissions                 : -rw-rw-rw-
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Big-endian (Motorola, MM)
[File]          ImageWidth                      : 1600
[File]          ImageHeight                     : 900
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:0 (2 2)
[JFIF]          JFIFVersion                     : 1.01
[JFIF]          ResolutionUnit                  : None
[JFIF]          XResolution                     : 1
[JFIF]          YResolution                     : 1
[IFD0]          XResolution                     : 1
[IFD0]          YResolution                     : 1
[IFD0]          ResolutionUnit                  : None
[IFD0]          YCbCrPositioning                : Centered
[ExifIFD]       ExifVersion                     : 0232
[ExifIFD]       CreateDate                      : 3001:01:12 00:00:00
[ExifIFD]       ComponentsConfiguration         : Y, Cb, Cr, -
[ExifIFD]       FlashpixVersion                 : 0100
[ExifIFD]       ColorSpace                      : Uncalibrated
[XMP-x]         XMPToolkit                      : Adobe XMP Core 5.1.2
[XMP-hdrgm]     Version                         : 1.0
[XMP-Container] DirectoryItemSemantic           : Primary
[XMP-Container] DirectoryItemMime               : image/jpeg
[XMP-Container] DirectoryItemSemantic           : GainMap
[XMP-Container] DirectoryItemMime               : image/jpeg
[XMP-Container] DirectoryItemLength             : 30011
[ICC-header]    ProfileCMMType                  :
[ICC-header]    ProfileVersion                  : 4.3.0
[ICC-header]    ProfileClass                    : Display Device Profile
[ICC-header]    ColorSpaceData                  : RGB
[ICC-header]    ProfileConnectionSpace          : XYZ
[ICC-header]    ProfileDateTime                 : 2016:01:01 00:00:00
[ICC-header]    ProfileFileSignature            : acsp
[ICC-header]    PrimaryPlatform                 : Unknown ()
[ICC-header]    CMMFlags                        : Not Embedded, Independent
[ICC-header]    DeviceManufacturer              :
[ICC-header]    DeviceModel                     :
[ICC-header]    DeviceAttributes                : Reflective, Glossy, Positive, Color
[ICC-header]    RenderingIntent                 : Media-Relative Colorimetric
[ICC-header]    ConnectionSpaceIlluminant       : 0.9642 1 0.82491
[ICC-header]    ProfileCreator                  :
[ICC-header]    ProfileID                       : 0
[ICC_Profile]   ProfileDescription              : sRGB
[ICC_Profile]   RedMatrixColumn                 : 0.43607 0.22249 0.01392
[ICC_Profile]   GreenMatrixColumn               : 0.38515 0.71687 0.09708
[ICC_Profile]   BlueMatrixColumn                : 0.14307 0.06061 0.7141
[ICC_Profile]   MediaWhitePoint                 : 0.9642 1 0.82491
[ICC_Profile]   RedTRC                          : (Binary data 40 bytes, use -b option to extract)
[ICC_Profile]   GreenTRC                        : (Binary data 40 bytes, use -b option to extract)
[ICC_Profile]   BlueTRC                         : (Binary data 40 bytes, use -b option to extract)
[ICC_Profile]   ProfileCopyright                : Google Inc. 2016
[MPF0]          MPFVersion                      : 0100
[MPF0]          NumberOfImages                  : 2
[MPImage1]      MPImageFlags                    : (none)
[MPImage1]      MPImageFormat                   : JPEG
[MPImage1]      MPImageType                     : Baseline MP Primary Image
[MPImage1]      MPImageLength                   : 283659
[MPImage1]      MPImageStart                    : 0
[MPImage1]      DependentImage1EntryNumber      : 0
[MPImage1]      DependentImage2EntryNumber      : 0
[MPImage2]      MPImageFlags                    : (none)
[MPImage2]      MPImageFormat                   : JPEG
[MPImage2]      MPImageType                     : Undefined
[MPImage2]      MPImageLength                   : 30011
[MPImage2]      MPImageStart                    : 283845
[MPImage2]      DependentImage1EntryNumber      : 0
[MPImage2]      DependentImage2EntryNumber      : 0
[MPImage2]      MPImage2                        : (Binary data 30011 bytes, use -b option to extract)
[Composite]     ImageSize                       : 1600x900
[Composite]     Megapixels                      : 1.4

Tag list for file that didn't have the CreateDate tag created:

[ExifTool]      ExifToolVersion                 : 12.84
[System]        FileName                        : two-edge.jpg
[System]        Directory                       : .
[System]        FileSize                        : 240 kB
[System]        ZoneIdentifier                  : Exists
[System]        FileModifyDate                  : 2024:05:10 11:27:20-06:00
[System]        FileAccessDate                  : 2024:05:10 12:01:02-06:00
[System]        FileCreateDate                  : 2024:05:10 11:33:33-06:00
[System]        FilePermissions                 : -rw-rw-rw-
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ImageWidth                      : 900
[File]          ImageHeight                     : 1600
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:0 (2 2)
[JFIF]          JFIFVersion                     : 1.01
[JFIF]          ResolutionUnit                  : None
[JFIF]          XResolution                     : 1
[JFIF]          YResolution                     : 1
[XMP-x]         XMPToolkit                      : Adobe XMP Core 5.1.2
[XMP-hdrgm]     Version                         : 1.0
[XMP-Container] DirectoryItemSemantic           : Primary
[XMP-Container] DirectoryItemMime               : image/jpeg
[XMP-Container] DirectoryItemSemantic           : GainMap
[XMP-Container] DirectoryItemMime               : image/jpeg
[XMP-Container] DirectoryItemLength             : 7043
[ICC-header]    ProfileCMMType                  :
[ICC-header]    ProfileVersion                  : 4.3.0
[ICC-header]    ProfileClass                    : Display Device Profile
[ICC-header]    ColorSpaceData                  : RGB
[ICC-header]    ProfileConnectionSpace          : XYZ
[ICC-header]    ProfileDateTime                 : 2016:01:01 00:00:00
[ICC-header]    ProfileFileSignature            : acsp
[ICC-header]    PrimaryPlatform                 : Unknown ()
[ICC-header]    CMMFlags                        : Not Embedded, Independent
[ICC-header]    DeviceManufacturer              :
[ICC-header]    DeviceModel                     :
[ICC-header]    DeviceAttributes                : Reflective, Glossy, Positive, Color
[ICC-header]    RenderingIntent                 : Media-Relative Colorimetric
[ICC-header]    ConnectionSpaceIlluminant       : 0.9642 1 0.82491
[ICC-header]    ProfileCreator                  :
[ICC-header]    ProfileID                       : 0
[ICC_Profile]   ProfileDescription              : sRGB
[ICC_Profile]   RedMatrixColumn                 : 0.43607 0.22249 0.01392
[ICC_Profile]   GreenMatrixColumn               : 0.38515 0.71687 0.09708
[ICC_Profile]   BlueMatrixColumn                : 0.14307 0.06061 0.7141
[ICC_Profile]   MediaWhitePoint                 : 0.9642 1 0.82491
[ICC_Profile]   RedTRC                          : (Binary data 40 bytes, use -b option to extract)
[ICC_Profile]   GreenTRC                        : (Binary data 40 bytes, use -b option to extract)
[ICC_Profile]   BlueTRC                         : (Binary data 40 bytes, use -b option to extract)
[ICC_Profile]   ProfileCopyright                : Google Inc. 2016
[MPF0]          MPFVersion                      : 0100
[MPF0]          NumberOfImages                  : 2
[MPImage1]      MPImageFlags                    : (none)
[MPImage1]      MPImageFormat                   : JPEG
[MPImage1]      MPImageType                     : Baseline MP Primary Image
[MPImage1]      MPImageLength                   : 232791
[MPImage1]      MPImageStart                    : 0
[MPImage1]      DependentImage1EntryNumber      : 0
[MPImage1]      DependentImage2EntryNumber      : 0
[MPImage2]      MPImageFlags                    : (none)
[MPImage2]      MPImageFormat                   : JPEG
[MPImage2]      MPImageType                     : Undefined
[MPImage2]      MPImageLength                   : 7043
[MPImage2]      MPImageStart                    : 232791
[MPImage2]      DependentImage1EntryNumber      : 0
[MPImage2]      DependentImage2EntryNumber      : 0
[MPImage2]      MPImage2                        : (Binary data 7043 bytes, use -b option to extract)
[Composite]     ImageSize                       : 900x1600
[Composite]     Megapixels                      : 1.4

Tag list for file downloaded through Android (same file as corrupted date file above):

[ExifTool]      ExifToolVersion                 : 12.84
[System]        FileName                        : one-phone.jpg
[System]        Directory                       : .
[System]        FileSize                        : 320 kB
[System]        FileModifyDate                  : 2024:05:10 11:51:44-06:00
[System]        FileAccessDate                  : 2024:05:10 12:00:13-06:00
[System]        FileCreateDate                  : 2024:05:10 11:33:33-06:00
[System]        FilePermissions                 : -rw-rw-rw-
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[File]          ImageWidth                      : 1600
[File]          ImageHeight                     : 900
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:0 (2 2)
[JFIF]          JFIFVersion                     : 1.01
[JFIF]          ResolutionUnit                  : None
[JFIF]          XResolution                     : 1
[JFIF]          YResolution                     : 1
[IFD0]          Software                        : Picasa
[ExifIFD]       ExifVersion                     : 0232
[ExifIFD]       CreateDate                      : 2024:05:08 12:00:00
[ExifIFD]       ComponentsConfiguration         : Y, Cb, Cr, -
[ExifIFD]       FlashpixVersion                 : 0100
[ExifIFD]       ColorSpace                      : Uncalibrated
[ICC-header]    ProfileCMMType                  :
[ICC-header]    ProfileVersion                  : 2.0.0
[ICC-header]    ProfileClass                    : Display Device Profile
[ICC-header]    ColorSpaceData                  : RGB
[ICC-header]    ProfileConnectionSpace          : XYZ
[ICC-header]    ProfileDateTime                 : 2009:03:27 21:36:31
[ICC-header]    ProfileFileSignature            : acsp
[ICC-header]    PrimaryPlatform                 : Unknown ()
[ICC-header]    CMMFlags                        : Not Embedded, Independent
[ICC-header]    DeviceManufacturer              :
[ICC-header]    DeviceModel                     :
[ICC-header]    DeviceAttributes                : Reflective, Glossy, Positive, Color
[ICC-header]    RenderingIntent                 : Perceptual
[ICC-header]    ConnectionSpaceIlluminant       : 0.9642 1 0.82491
[ICC-header]    ProfileCreator                  :
[ICC-header]    ProfileID                       : 29f83ddeaff255ae7842fae4ca83390d
[ICC_Profile]   ProfileDescription              : sRGB IEC61966-2-1 black scaled
[ICC_Profile]   BlueMatrixColumn                : 0.14307 0.06061 0.7141
[ICC_Profile]   BlueTRC                         : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   DeviceModelDesc                 : IEC 61966-2-1 Default RGB Colour Space - sRGB
[ICC_Profile]   GreenMatrixColumn               : 0.38515 0.71687 0.09708
[ICC_Profile]   GreenTRC                        : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   Luminance                       : 0 80 0
[ICC_Profile]   MediaBlackPoint                 : 0.01205 0.0125 0.01031
[ICC_Profile]   RedMatrixColumn                 : 0.43607 0.22249 0.01392
[ICC_Profile]   RedTRC                          : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   Technology                      : Cathode Ray Tube Display
[ICC_Profile]   ViewingCondDesc                 : Reference Viewing Condition in IEC 61966-2-1
[ICC_Profile]   MediaWhitePoint                 : 0.9642 1 0.82491
[ICC_Profile]   ProfileCopyright                : Copyright International Color Consortium, 2009
[ICC_Profile]   ChromaticAdaptation             : 1.04791 0.02293 -0.0502 0.0296 0.99046 -0.01707 -0.00925 0.01506 0.75179
[ICC-meas]      MeasurementObserver             : CIE 1931
[ICC-meas]      MeasurementBacking              : 0 0 0
[ICC-meas]      MeasurementGeometry             : Unknown
[ICC-meas]      MeasurementFlare                : 0%
[ICC-meas]      MeasurementIlluminant           : D65
[Composite]     ImageSize                       : 1600x900
[Composite]     Megapixels                      : 1.4

Tag list for file downloaded through Android (same file as no CreateDate tag file above):

[ExifTool]      ExifToolVersion                 : 12.84
[System]        FileName                        : two-phone.jpg
[System]        Directory                       : .
[System]        FileSize                        : 264 kB
[System]        FileModifyDate                  : 2024:05:10 11:51:44-06:00
[System]        FileAccessDate                  : 2024:05:10 12:02:53-06:00
[System]        FileCreateDate                  : 2024:05:10 11:33:33-06:00
[System]        FilePermissions                 : -rw-rw-rw-
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[File]          ImageWidth                      : 900
[File]          ImageHeight                     : 1600
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:0 (2 2)
[JFIF]          JFIFVersion                     : 1.01
[JFIF]          ResolutionUnit                  : None
[JFIF]          XResolution                     : 1
[JFIF]          YResolution                     : 1
[IFD0]          Software                        : Picasa
[ExifIFD]       ExifVersion                     : 0232
[ExifIFD]       CreateDate                      : 2024:05:08 12:00:00
[ExifIFD]       ComponentsConfiguration         : Y, Cb, Cr, -
[ExifIFD]       FlashpixVersion                 : 0100
[ExifIFD]       ColorSpace                      : Uncalibrated
[ICC-header]    ProfileCMMType                  :
[ICC-header]    ProfileVersion                  : 2.0.0
[ICC-header]    ProfileClass                    : Display Device Profile
[ICC-header]    ColorSpaceData                  : RGB
[ICC-header]    ProfileConnectionSpace          : XYZ
[ICC-header]    ProfileDateTime                 : 2009:03:27 21:36:31
[ICC-header]    ProfileFileSignature            : acsp
[ICC-header]    PrimaryPlatform                 : Unknown ()
[ICC-header]    CMMFlags                        : Not Embedded, Independent
[ICC-header]    DeviceManufacturer              :
[ICC-header]    DeviceModel                     :
[ICC-header]    DeviceAttributes                : Reflective, Glossy, Positive, Color
[ICC-header]    RenderingIntent                 : Perceptual
[ICC-header]    ConnectionSpaceIlluminant       : 0.9642 1 0.82491
[ICC-header]    ProfileCreator                  :
[ICC-header]    ProfileID                       : 29f83ddeaff255ae7842fae4ca83390d
[ICC_Profile]   ProfileDescription              : sRGB IEC61966-2-1 black scaled
[ICC_Profile]   BlueMatrixColumn                : 0.14307 0.06061 0.7141
[ICC_Profile]   BlueTRC                         : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   DeviceModelDesc                 : IEC 61966-2-1 Default RGB Colour Space - sRGB
[ICC_Profile]   GreenMatrixColumn               : 0.38515 0.71687 0.09708
[ICC_Profile]   GreenTRC                        : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   Luminance                       : 0 80 0
[ICC_Profile]   MediaBlackPoint                 : 0.01205 0.0125 0.01031
[ICC_Profile]   RedMatrixColumn                 : 0.43607 0.22249 0.01392
[ICC_Profile]   RedTRC                          : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   Technology                      : Cathode Ray Tube Display
[ICC_Profile]   ViewingCondDesc                 : Reference Viewing Condition in IEC 61966-2-1
[ICC_Profile]   MediaWhitePoint                 : 0.9642 1 0.82491
[ICC_Profile]   ProfileCopyright                : Copyright International Color Consortium, 2009
[ICC_Profile]   ChromaticAdaptation             : 1.04791 0.02293 -0.0502 0.0296 0.99046 -0.01707 -0.00925 0.01506 0.75179
[ICC-meas]      MeasurementObserver             : CIE 1931
[ICC-meas]      MeasurementBacking              : 0 0 0
[ICC-meas]      MeasurementGeometry             : Unknown
[ICC-meas]      MeasurementFlare                : 0%
[ICC-meas]      MeasurementIlluminant           : D65
[Composite]     ImageSize                       : 900x1600
[Composite]     Megapixels                      : 1.4

Hoping something points to the problem(s)...

RRRichard

Just to emphasize... the CreateDate tag is created properly in both the Android downloaded files but I can't imagine how the different EXIF data in the Windows downloaded files could impact Exiftool like this???

RRRichard

Still trying to figure this out. I ran the following command:

exiftool -listw <filename>

on each of the 4 jpg files I'm testing with. The output list showed the CreateDate tag for all 4 files. I assume this means I should be able to write the CreateDate tag to each file. My command to do that:

exiftool -r -m -overwrite_original "-CreateDate<${directory;s/.*(\d{4})-(\d\d)-(\d\d).*/$1:$2:$3/} 12:00:00" .

is successful on 2 files (downloaded on my Android phone) and fails on 2 files (downloaded through my Windows browser). On one file, the tag is written but has a corrupt date value. On the other file, the tag isn't written and a "No writable tags set from <file>" is generated - even though the tag is listed with the -listw command.

I run the exiftool command inside a batch file being executed at a Windows command prompt with admin rights. Is this an acceptable way to use exiftool (as opposed to typing the entire command at the command prompt)?

Is there any documentation that explains this portion of my exiftool command?

"-CreateDate<${directory;s/.*(\d{4})-(\d\d)-(\d\d).*/$1:$2:$3/} 12:00:00"

I know what it should do but I did not come up with this myself and I would like to understand it.

Thanks in advance for any pointers.

Phil Harvey

I don't have time to read through this entire thread, but the -listw command doesn't take a file name as an argument.  This is a global list of all writable tags.

On the 2 failed files, what is the directory name, and what is written?

There is no ExifTool documentation for the syntax of the advanced formatting expressions.  Any Perl expression involving $_ may be used.  Here, the s/// is a substitution expression.  See the Perl regular expressions documentation for more information.

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

RRRichard

Phil,

Thank you for popping in on this! My mistake on the -listw command - but again, "learning" through mistakes (hopefully).

I will follow up on the pointer to the Perl documentation - that's a new starting point for me.

All 4 files I'm testing with are in this directory:

C:\Users\Richard\Downloads\Photos\2024-05-08-NewCar

I run the exiftool command in the "C:\Users\Richard\Downloads\Photos" folder.

In the two successful files I get "CreateDate                      : 2024:05:08 12:00:00"

In the one failed file I get "CreateDate                      : 3001:01:12 00:00:00"

In the other failed file the CreateDate tag is not written and I see "Warning: No writable tags set from ./2024-05-08-NewCar/two-desktop.jpg"

Initially, none of the files have a CreateDate tag (exiftool -s <file>)

Any ideas?

Phil Harvey

This is really a mystery.  I don't see any way you could get a "No writable tags" warning for one file and not the others in the same directory because the command is using only the Directory name and none of the tags from the file.

Could you run the command with the -v3 option and post the text output result here?  You can add " > out.txt" at the end of the command to send the output to a file, then attach that file here.

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

RRRichard

Yes, "mystery" is a good word on my end too...

I ran this command:

exiftool -r -m -v3 -overwrite_original "-CreateDate<${directory;s/.*(\d{4})-(\d\d)-(\d\d).*/$1:$2:$3/} 12:00:00" . > out.txt

The out.txt is attached - hope it shows something.

Phil Harvey

OK.  I see.  Tricky.  Your files contain an XMP structure named Directory which is overriding the file Directory.  The Directory ItemLength of 30011 is giving the year 3001.  You should be able to fix this by specifying file:directory instead of directory in the command.  This is the first time I have seen this.

- Phil

Edit:  I will raise the priority of the File:Directory (and a few other File tags) in ExifTool 12.85 to prevent this confusion in the future.
...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 ($).

RRRichard

Phil,

OMG! You nailed it! I reran my command and everything is perfect! THANK YOU so much!!!! This explains past problems and prevents future ones! Very glad that ExifTool will improve further from this incident.

I would never have figured that out... this ex-Deep River boy really appreciates your Sudbury expertise! :o)

Perhaps the "ExifTool Freak" handle should be changed to "ExifTool God"?

Phil Harvey

Quote from: RRRichard on May 11, 2024, 10:10:48 PMPerhaps the "ExifTool Freak" handle should be changed to "ExifTool God"?

LOL.

Glad to have figured it out.

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