Time error in Photos.app and Google photos

Started by wywh, August 30, 2020, 08:13:45 AM

Previous topic - Next topic

wywh

Hello,

I noticed that I have a lot of random .jpg files where Mac Photos.app 4.0 and Google photos show the time as 0.00.00 although it is correctly in "[ExifIFD] DateTimeOriginal". The date is displayed and sorted correctly but such images are incorrectly sorted at midnight.

I believe most of those images are originally DJI Phantom 3 Pro or Canon EOS 550D or 6D raw .dng or .cr files edited and exported as .jpg from Lightroom 5.7 or 6.14 (but the majority of such images are OK).

I can fix them by rebuilding the metadata with:

exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile bad.jpg

Is it possible to filter out the .jpg files that need fixing? I'd rather not run that command to all 35 000 images in the archive.

Why can't Photos.app and Google Photos get the correct time? Attached is a zipped sample file and below its metadata:

exiftool -a -G1 -s 2016-0603-2229-58.jpg
[ExifTool]      ExifToolVersion                 : 12.00
[System]        FileName                        : 2016-0603-2229-58.jpg
[System]        Directory                       : .
[System]        FileSize                        : 1907 kB
[System]        FileModifyDate                  : 2016:06:03 22:29:58+03:00
[System]        FileAccessDate                  : 2020:08:30 15:03:18+03:00
[System]        FileInodeChangeDate             : 2020:08:30 14:55:48+03:00
[System]        FilePermissions                 : rwxr-xr-x
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[File]          CurrentIPTCDigest               : 8bedb7d5a5f8fb19e6a23e23bcb82242
[File]          ImageWidth                      : 3950
[File]          ImageHeight                     : 2222
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:4:4 (1 1)
[IFD0]          Make                            : DJI
[IFD0]          Model                           : FC300X
[IFD0]          XResolution                     : 240
[IFD0]          YResolution                     : 240
[IFD0]          ResolutionUnit                  : inches
[IFD0]          Software                        : Adobe Photoshop Lightroom 5.7 (Macintosh)
[IFD0]          ModifyDate                      : 2016:06:05 22:43:48
[ExifIFD]       ExposureTime                    : 1/400
[ExifIFD]       FNumber                         : 2.8
[ExifIFD]       ExposureProgram                 : Unknown (8176)
[ExifIFD]       ISO                             : 100
[ExifIFD]       ExifVersion                     : 0230
[ExifIFD]       DateTimeOriginal                : 2016:06:03 22:29:58
[ExifIFD]       CreateDate                      : 2016:06:03 22:29:58
[ExifIFD]       ShutterSpeedValue               : 1/400
[ExifIFD]       ApertureValue                   : 2.8
[ExifIFD]       ExposureCompensation            : 0
[ExifIFD]       MaxApertureValue                : 2.0
[ExifIFD]       SubjectDistance                 : 0 m
[ExifIFD]       MeteringMode                    : Center-weighted average
[ExifIFD]       LightSource                     : Unknown
[ExifIFD]       Flash                           : No flash function
[ExifIFD]       FocalLength                     : 3.6 mm
[ExifIFD]       FileSource                      : Digital Camera
[ExifIFD]       SceneType                       : Directly photographed
[ExifIFD]       CustomRendered                  : Normal
[ExifIFD]       ExposureMode                    : Manual
[ExifIFD]       WhiteBalance                    : Manual
[ExifIFD]       DigitalZoomRatio                : 0
[ExifIFD]       FocalLengthIn35mmFormat         : 20 mm
[ExifIFD]       SceneCaptureType                : Standard
[ExifIFD]       GainControl                     : None
[ExifIFD]       Contrast                        : Low
[ExifIFD]       Saturation                      : Low
[ExifIFD]       Sharpness                       : Soft
[ExifIFD]       SubjectDistanceRange            : Unknown
[ExifIFD]       SerialNumber                    : 2014031100
[ExifIFD]       LensInfo                        : 20.7mm f/?
[ExifIFD]       LensModel                       : 20.7 mm
[GPS]           GPSVersionID                    : 2.3.0.0
[GPS]           GPSLatitudeRef                  : North
[GPS]           GPSLatitude                     : 62 deg 51' 56.09"
[GPS]           GPSLongitudeRef                 : East
[GPS]           GPSLongitude                    : 22 deg 50' 20.45"
[GPS]           GPSAltitudeRef                  : Above Sea Level
[GPS]           GPSAltitude                     : 64.647 m
[IFD1]          Compression                     : JPEG (old-style)
[IFD1]          XResolution                     : 72
[IFD1]          YResolution                     : 72
[IFD1]          ResolutionUnit                  : inches
[IFD1]          ThumbnailOffset                 : 1014
[IFD1]          ThumbnailLength                 : 6100
[IFD1]          ThumbnailImage                  : (Binary data 6100 bytes, use -b option to extract)
[ICC-header]    ProfileCMMType                  : Linotronic
[ICC-header]    ProfileVersion                  : 2.1.0
[ICC-header]    ProfileClass                    : Display Device Profile
[ICC-header]    ColorSpaceData                  : RGB
[ICC-header]    ProfileConnectionSpace          : XYZ
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[ICC-header]    ProfileFileSignature            : acsp
[ICC-header]    PrimaryPlatform                 : Microsoft Corporation
[ICC-header]    CMMFlags                        : Not Embedded, Independent
[ICC-header]    DeviceManufacturer              : Hewlett-Packard
[ICC-header]    DeviceModel                     : sRGB
[ICC-header]    DeviceAttributes                : Reflective, Glossy, Positive, Color
[ICC-header]    RenderingIntent                 : Perceptual
[ICC-header]    ConnectionSpaceIlluminant       : 0.9642 1 0.82491
[ICC-header]    ProfileCreator                  : Hewlett-Packard
[ICC-header]    ProfileID                       : 0
[ICC_Profile]   ProfileCopyright                : Copyright (c) 1998 Hewlett-Packard Company
[ICC_Profile]   ProfileDescription              : sRGB IEC61966-2.1
[ICC_Profile]   MediaWhitePoint                 : 0.95045 1 1.08905
[ICC_Profile]   MediaBlackPoint                 : 0 0 0
[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]   DeviceMfgDesc                   : IEC http://www.iec.ch
[ICC_Profile]   DeviceModelDesc                 : IEC 61966-2.1 Default RGB colour space - sRGB
[ICC_Profile]   ViewingCondDesc                 : Reference Viewing Condition in IEC61966-2.1
[ICC_Profile]   Luminance                       : 76.03647 80 87.12462
[ICC_Profile]   Technology                      : Cathode Ray Tube Display
[ICC_Profile]   RedTRC                          : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   GreenTRC                        : (Binary data 2060 bytes, use -b option to extract)
[ICC_Profile]   BlueTRC                         : (Binary data 2060 bytes, use -b option to extract)
[ICC-view]      ViewingCondIlluminant           : 19.6445 20.3718 16.8089
[ICC-view]      ViewingCondSurround             : 3.92889 4.07439 3.36179
[ICC-view]      ViewingCondIlluminantType       : D50
[ICC-meas]      MeasurementObserver             : CIE 1931
[ICC-meas]      MeasurementBacking              : 0 0 0
[ICC-meas]      MeasurementGeometry             : Unknown
[ICC-meas]      MeasurementFlare                : 0.999%
[ICC-meas]      MeasurementIlluminant           : D65
[Photoshop]     XResolution                     : 240
[Photoshop]     DisplayedUnitsX                 : inches
[Photoshop]     YResolution                     : 240
[Photoshop]     DisplayedUnitsY                 : inches
[Photoshop]     PhotoshopThumbnail              : (Binary data 6100 bytes, use -b option to extract)
[Photoshop]     IPTCDigest                      : 141e9ddebd0b4cd22089aee0bf669055
[IPTC]          CodedCharacterSet               : UTF8
[IPTC]          ApplicationRecordVersion        : 2
[IPTC]          DateCreated                     : 2016:06:03
[IPTC]          DigitalCreationDate             : 2016:06:03
[IPTC]          City                            : Seinäjoki
[IPTC]          Province-State                  : Southern Ostrobothnia
[IPTC]          Country-PrimaryLocationName     : Finland
[IPTC]          Keywords                        : Ilmakuva
[XMP-x]         XMPToolkit                      : XMP Core 5.6.0
[XMP-rdf]       About                           : DJI Meta Data
[XMP-xmp]       ModifyDate                      : 2019:04:20 11:14:52+03:00
[XMP-xmp]       CreateDate                      : 2016:06:03 12:00:00+03:00
[XMP-xmp]       CreatorTool                     : Adobe Photoshop Lightroom 5.7 (Macintosh)
[XMP-xmp]       MetadataDate                    : 2019:04:20 11:14:52+03:00
[XMP-xmp]       Rating                          : 2
[XMP-dc]        Format                          : image/jpeg
[XMP-dc]        Subject                         : Ilmakuva
[XMP-drone-dji] AbsoluteAltitude                : +64.75
[XMP-drone-dji] RelativeAltitude                : +29.80
[XMP-drone-dji] GimbalRollDegree                : +0.00
[XMP-drone-dji] GimbalYawDegree                 : -54.90
[XMP-drone-dji] GimbalPitchDegree               : -2.30
[XMP-drone-dji] FlightRollDegree                : +4.20
[XMP-drone-dji] FlightYawDegree                 : -55.40
[XMP-drone-dji] FlightPitchDegree               : -2.70
[XMP-aux]       SerialNumber                    : 2014031100
[XMP-aux]       LensInfo                        : 20.7mm f/?
[XMP-aux]       Lens                            : 20.7 mm
[XMP-aux]       ApproximateFocusDistance        : 0
[XMP-photoshop] DateCreated                     : 2016:06:03
[XMP-photoshop] City                            : Seinäjoki
[XMP-photoshop] State                           : Southern Ostrobothnia
[XMP-photoshop] Country                         : Finland
[XMP-xmpMM]     DocumentID                      : xmp.did:ca7ac041-e314-445f-9416-b3144d628aee
[XMP-xmpMM]     OriginalDocumentID              : 7C5BCA42DD96F71A01E96F5DEC2EACCE
[XMP-xmpMM]     InstanceID                      : xmp.iid:ca7ac041-e314-445f-9416-b3144d628aee
[XMP-xmpMM]     HistoryAction                   : converted, derived, saved
[XMP-xmpMM]     HistoryParameters               : from image/tiff to image/dng, converted from image/dng to image/jpeg, saved to new location
[XMP-xmpMM]     HistoryInstanceID               : xmp.iid:ca7ac041-e314-445f-9416-b3144d628aee
[XMP-xmpMM]     HistoryWhen                     : 2016:06:05 22:43:48+03:00
[XMP-xmpMM]     HistorySoftwareAgent            : Adobe Photoshop Lightroom 5.7 (Macintosh)
[XMP-xmpMM]     HistoryChanged                  : /
[XMP-xmpMM]     DerivedFromDocumentID           : 7C5BCA42DD96F71A01E96F5DEC2EACCE
[XMP-xmpMM]     DerivedFromOriginalDocumentID   : 7C5BCA42DD96F71A01E96F5DEC2EACCE
[XMP-crs]       Version                         : 8.7
[XMP-crs]       ProcessVersion                  : 6.7
[XMP-crs]       WhiteBalance                    : As Shot
[XMP-crs]       AutoWhiteVersion                : 134348800
[XMP-crs]       ColorTemperature                : 5100
[XMP-crs]       Tint                            : +1
[XMP-crs]       Saturation                      : +6
[XMP-crs]       Sharpness                       : 25
[XMP-crs]       LuminanceSmoothing              : 0
[XMP-crs]       ColorNoiseReduction             : 25
[XMP-crs]       VignetteAmount                  : 0
[XMP-crs]       ShadowTint                      : 0
[XMP-crs]       RedHue                          : 0
[XMP-crs]       RedSaturation                   : 0
[XMP-crs]       GreenHue                        : 0
[XMP-crs]       GreenSaturation                 : 0
[XMP-crs]       BlueHue                         : 0
[XMP-crs]       BlueSaturation                  : 0
[XMP-crs]       Vibrance                        : +56
[XMP-crs]       HueAdjustmentRed                : 0
[XMP-crs]       HueAdjustmentOrange             : 0
[XMP-crs]       HueAdjustmentYellow             : 0
[XMP-crs]       HueAdjustmentGreen              : 0
[XMP-crs]       HueAdjustmentAqua               : 0
[XMP-crs]       HueAdjustmentBlue               : 0
[XMP-crs]       HueAdjustmentPurple             : 0
[XMP-crs]       HueAdjustmentMagenta            : 0
[XMP-crs]       SaturationAdjustmentRed         : 0
[XMP-crs]       SaturationAdjustmentOrange      : 0
[XMP-crs]       SaturationAdjustmentYellow      : 0
[XMP-crs]       SaturationAdjustmentGreen       : 0
[XMP-crs]       SaturationAdjustmentAqua        : 0
[XMP-crs]       SaturationAdjustmentBlue        : 0
[XMP-crs]       SaturationAdjustmentPurple      : 0
[XMP-crs]       SaturationAdjustmentMagenta     : 0
[XMP-crs]       LuminanceAdjustmentRed          : 0
[XMP-crs]       LuminanceAdjustmentOrange       : 0
[XMP-crs]       LuminanceAdjustmentYellow       : 0
[XMP-crs]       LuminanceAdjustmentGreen        : 0
[XMP-crs]       LuminanceAdjustmentAqua         : 0
[XMP-crs]       LuminanceAdjustmentBlue         : 0
[XMP-crs]       LuminanceAdjustmentPurple       : 0
[XMP-crs]       LuminanceAdjustmentMagenta      : 0
[XMP-crs]       SplitToningShadowHue            : 0
[XMP-crs]       SplitToningShadowSaturation     : 0
[XMP-crs]       SplitToningHighlightHue         : 0
[XMP-crs]       SplitToningHighlightSaturation  : 0
[XMP-crs]       SplitToningBalance              : 0
[XMP-crs]       ParametricShadows               : 0
[XMP-crs]       ParametricDarks                 : 0
[XMP-crs]       ParametricLights                : 0
[XMP-crs]       ParametricHighlights            : 0
[XMP-crs]       ParametricShadowSplit           : 25
[XMP-crs]       ParametricMidtoneSplit          : 50
[XMP-crs]       ParametricHighlightSplit        : 75
[XMP-crs]       SharpenRadius                   : +1.0
[XMP-crs]       SharpenDetail                   : 25
[XMP-crs]       SharpenEdgeMasking              : 0
[XMP-crs]       PostCropVignetteAmount          : 0
[XMP-crs]       GrainAmount                     : 0
[XMP-crs]       ColorNoiseReductionDetail       : 50
[XMP-crs]       ColorNoiseReductionSmoothness   : 50
[XMP-crs]       LensProfileEnable               : 0
[XMP-crs]       LensManualDistortionAmount      : 0
[XMP-crs]       PerspectiveVertical             : 0
[XMP-crs]       PerspectiveHorizontal           : 0
[XMP-crs]       PerspectiveRotate               : 0.0
[XMP-crs]       PerspectiveScale                : 100
[XMP-crs]       PerspectiveAspect               : 0
[XMP-crs]       PerspectiveUpright              : 0
[XMP-crs]       AutoLateralCA                   : 0
[XMP-crs]       Exposure2012                    : +1.10
[XMP-crs]       Contrast2012                    : +4
[XMP-crs]       Highlights2012                  : -100
[XMP-crs]       Shadows2012                     : -14
[XMP-crs]       Whites2012                      : -100
[XMP-crs]       Blacks2012                      : -17
[XMP-crs]       Clarity2012                     : +26
[XMP-crs]       DefringePurpleAmount            : 0
[XMP-crs]       DefringePurpleHueLo             : 30
[XMP-crs]       DefringePurpleHueHi             : 70
[XMP-crs]       DefringeGreenAmount             : 0
[XMP-crs]       DefringeGreenHueLo              : 40
[XMP-crs]       DefringeGreenHueHi              : 60
[XMP-crs]       ConvertToGrayscale              : False
[XMP-crs]       ToneCurveName                   : Linear
[XMP-crs]       ToneCurveName2012               : Linear
[XMP-crs]       CameraProfile                   : Embedded
[XMP-crs]       LensProfileSetup                : LensDefaults
[XMP-crs]       HasSettings                     : True
[XMP-crs]       CropTop                         : 0.190426
[XMP-crs]       CropLeft                        : 0.005755
[XMP-crs]       CropBottom                      : 0.943468
[XMP-crs]       CropRight                       : 0.991281
[XMP-crs]       CropAngle                       : 0.441738
[XMP-crs]       CropConstrainToWarp             : 0
[XMP-crs]       HasCrop                         : True
[XMP-crs]       AlreadyApplied                  : True
[XMP-crs]       ToneCurve                       : 0, 0, 255, 255
[XMP-crs]       ToneCurveRed                    : 0, 0, 255, 255
[XMP-crs]       ToneCurveGreen                  : 0, 0, 255, 255
[XMP-crs]       ToneCurveBlue                   : 0, 0, 255, 255
[XMP-crs]       ToneCurvePV2012                 : 0, 0, 255, 255
[XMP-crs]       ToneCurvePV2012Red              : 0, 0, 255, 255
[XMP-crs]       ToneCurvePV2012Green            : 0, 0, 255, 255
[XMP-crs]       ToneCurvePV2012Blue             : 0, 0, 255, 255
[Adobe]         DCTEncodeVersion                : 100
[Adobe]         APP14Flags0                     : [14], Encoded with Blend=1 downsampling
[Adobe]         APP14Flags1                     : (none)
[Adobe]         ColorTransform                  : YCbCr
[Composite]     Aperture                        : 2.8
[Composite]     ImageSize                       : 3950x2222
[Composite]     LensID                          : 20.7 mm
[Composite]     Megapixels                      : 8.8
[Composite]     ScaleFactor35efl                : 5.5
[Composite]     ShutterSpeed                    : 1/400
[Composite]     GPSAltitude                     : 64.6 m Above Sea Level
[Composite]     GPSLatitude                     : 62 deg 51' 56.09" N
[Composite]     GPSLongitude                    : 22 deg 50' 20.45" E
[Composite]     CircleOfConfusion               : 0.005 mm
[Composite]     DOF                             : inf (0.00 m - inf)
[Composite]     FOV                             : 84.0 deg
[Composite]     FocalLength35efl                : 3.6 mm (35 mm equivalent: 20.0 mm)
[Composite]     GPSPosition                     : 62 deg 51' 56.09" N, 22 deg 50' 20.45" E
[Composite]     HyperfocalDistance              : 0.86 m
[Composite]     LightValue                      : 11.6


thanks,

- Matti

StarGeek

There are a couple possibilities here.  Looking at the time output specifically
C:\>exiftool -time:all -G1 -a -s Y:\!temp\ccccc\2016-0603-2229-58.jpg
[System]        FileModifyDate                  : 2016:06:03 22:29:58-07:00
[System]        FileAccessDate                  : 2020:08:30 09:16:54-07:00
[System]        FileCreateDate                  : 2020:08:30 09:16:54-07:00
[IFD0]          ModifyDate                      : 2016:06:05 22:43:48
[ExifIFD]       DateTimeOriginal                : 2016:06:03 22:29:58
[ExifIFD]       CreateDate                      : 2016:06:03 22:29:58
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[IPTC]          DateCreated                     : 2016:06:03
[IPTC]          DigitalCreationDate             : 2016:06:03
[XMP-xmp]       ModifyDate                      : 2019:04:20 11:14:52+03:00
[XMP-xmp]       CreateDate                      : 2016:06:03 12:00:00+03:00
[XMP-xmp]       MetadataDate                    : 2019:04:20 11:14:52+03:00
[XMP-photoshop] DateCreated                     : 2016:06:03
[XMP-xmpMM]     HistoryWhen                     : 2016:06:05 22:43:48+03:00


IPTC:DateCreated and IPTC:DigitalCreationDate exists, but the matching IPTC:TimeCreated/IPTC:DigitalCreationDate tags do not.  Also, XMP:CreateDate has the time incorrectly set.  The XMP:DateCreated only has the date portion.

You could try either removing all four of those tags, or try setting XMP:CreateDate/XMP:DateCreated correctly and adding IPTC:TimeCreated/IPTC:DigitalCreationDate.
"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

wywh

#2
Quote from: StarGeek on August 30, 2020, 12:25:23 PM
IPTC:DateCreated and IPTC:DigitalCreationDate exists, but the matching IPTC:TimeCreated/IPTC:DigitalCreationDate tags do not.  Also, XMP:CreateDate has the time incorrectly set.  The XMP:DateCreated only has the date portion.

Thanks for the reply. If I rebuild the metadata all those tags remain the same while then Photos.app and Google Photos do see the correct time. Also removing IPTC:DateCreated and IPTC:DigitalCreationDate fixed the error.

I wish there was some common apparent flaw in the tags I could search to filter the offending random files apart so I could fix just their metadata.

Maybe I could search for missing IPTC TimeCreated & DigitalCreationTime tags and see if all those images have this error? What kind of command would move such images to another folder, for example?

A much more laborious approach would be to manually inspect all 35 000 images in Photos.app Get Info dialog. In fact I started to make a list until I noticed there were dozens of such files randomly scattered.

- Matti

StarGeek

Quote from: wywh on August 30, 2020, 12:51:22 PM
Thanks for the reply. If I rebuild the metadata all those tags remain the same while then Photos.app and Google Photos do see the correct time. Also removing IPTC:DateCreated and IPTC:DigitalCreationDate fixed the error.

I wish there was some common apparent flaw in the tags I could search to filter the offending random files apart so I could fix just their metadata.

When I was doing some tests on Google Photos, it became apparent to me that there was no priority to which tags were read.  Every file that was processed with exiftool picked the DateTimeOriginal tag as the timestamp, but other files it was pretty random.  My best guess was that it had to do with the order the data appeared in the file.  The way exiftool wrote the data ended up with DateTimeOriginal being used.  So not a flaw in the data, just the order it was written.

QuoteMaybe I could search for missing IPTC TimeCreated & DigitalCreationTime tags and see if all those images have this error? What kind of command would move such images to another folder, for example?

Something like
exiftool -if "not $IPTC:TimeCreated" -Directory=/path/to/questionables/ /path/to/source
"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

wywh

#4
Quote from: StarGeek on August 30, 2020, 03:27:38 PM
exiftool -if "not $IPTC:TimeCreated" -Directory=/path/to/questionables/ /path/to/source

Thanks, that command works but it has lots of false positives like iOS .jpg files that have no IPTC or XMP date tags.

Many offending files seem to be from Lightroom 5.7. How can I filter them for testing? I could not yet build a filter for [IFD0] Software: Adobe Photoshop Lightroom 5.7 (Macintosh)

If I can't find a lowest common denominator for the offending files maybe I have to manually try pick them or use brute force for all .jpg files. What would be to best least destructive and risky way to do this?

Rebuilding all metadata might not cause any damage but seems excessive when maybe the error is caused by viewers that can't correctly read the metadata.

I usually use GraphicConverter that uses exiftool under the hood. It has "Copy Exif Date to all other Metadata Dates" command that I have used to fix some stubborn time errors in Google Photos and it seems to fix also this similar error.

I don't know what exact command GraphicConverter uses to sync (almost) all metadata dates. Is there an exiftool command that does a similar task?

Below are the date tags of the a) original file with this time error, b) after exiftool rebuild its metadata and c) after GraphicConverter's copy EXIF date command:

Rebuilding metadata seems to just re-arrange essentially the same tags in different order.

GraphicConverter's "Copy EXIF date to all other Metadata Dates" corrects IFD0:ModifyDate, deletes IPTC dates and corrects and re-arranges and creates new XMP dates:

exiftool -a -G1 -s -time:all 2016-0603-2229-58_original.jpg
[System]        FileModifyDate                  : 2016:06:03 22:29:58+03:00
[System]        FileAccessDate                  : 2020:08:31 18:30:40+03:00
[System]        FileInodeChangeDate             : 2020:08:31 18:26:39+03:00
[IFD0]          ModifyDate                      : 2016:06:05 22:43:48
[ExifIFD]       DateTimeOriginal                : 2016:06:03 22:29:58
[ExifIFD]       CreateDate                      : 2016:06:03 22:29:58
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[IPTC]          DateCreated                     : 2016:06:03
[IPTC]          DigitalCreationDate             : 2016:06:03
[XMP-xmp]       ModifyDate                      : 2019:04:20 11:14:52+03:00
[XMP-xmp]       CreateDate                      : 2016:06:03 12:00:00+03:00
[XMP-xmp]       MetadataDate                    : 2019:04:20 11:14:52+03:00
[XMP-photoshop] DateCreated                     : 2016:06:03
[XMP-xmpMM]     HistoryWhen                     : 2016:06:05 22:43:48+03:00


exiftool -a -G1 -s -time:all 2016-0603-2229-58_rebuild.jpg
[System]        FileModifyDate                  : 2020:08:31 18:27:57+03:00
[System]        FileAccessDate                  : 2020:08:31 18:27:59+03:00
[System]        FileInodeChangeDate             : 2020:08:31 18:27:57+03:00
[IFD0]          ModifyDate                      : 2016:06:05 22:43:48
[ExifIFD]       DateTimeOriginal                : 2016:06:03 22:29:58
[ExifIFD]       CreateDate                      : 2016:06:03 22:29:58
[IPTC]          DateCreated                     : 2016:06:03
[IPTC]          DigitalCreationDate             : 2016:06:03
[XMP-photoshop] DateCreated                     : 2016:06:03
[XMP-xmp]       CreateDate                      : 2016:06:03 12:00:00+03:00
[XMP-xmp]       MetadataDate                    : 2019:04:20 11:14:52+03:00
[XMP-xmp]       ModifyDate                      : 2019:04:20 11:14:52+03:00
[XMP-xmpMM]     HistoryWhen                     : 2016:06:05 22:43:48+03:00
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00


exiftool -a -G1 -s -time:all 2016-0603-2229-58_gc_copy.jpg
[System]        FileModifyDate                  : 2016:06:03 22:29:58+03:00
[System]        FileAccessDate                  : 2020:08:31 18:28:44+03:00
[System]        FileInodeChangeDate             : 2020:08:31 18:28:42+03:00
[IFD0]          ModifyDate                      : 2016:06:03 22:29:58
[ExifIFD]       DateTimeOriginal                : 2016:06:03 22:29:58
[ExifIFD]       CreateDate                      : 2016:06:03 22:29:58
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[XMP-exif]      DateTimeDigitized               : 2016:06:03 22:29:58
[XMP-exif]      DateTimeOriginal                : 2016:06:03 22:29:58
[XMP-photoshop] DateCreated                     : 2016:06:03 22:29:58
[XMP-xmp]       CreateDate                      : 2016:06:03 22:29:58
[XMP-xmp]       MetadataDate                    : 2019:04:20 11:14:52+03:00
[XMP-xmp]       ModifyDate                      : 2016:06:03 22:29:58
[XMP-xmpMM]     HistoryWhen                     : 2016:06:05 22:43:48+03:00


- Matti

StarGeek

Quote from: wywh on August 31, 2020, 01:12:43 PM
Thanks, that command works but it has lots of false positives like iOS .jpg files that have no IPTC or XMP date tags.

Ok, try
-if "$IPTC:DateCreated and not $IPTC:TimeCreated"

QuoteMany offending files seem to be from Lightroom 5.7. How can I filter them for testing? I could not yet build a filter for [IFD0] Software: Adobe Photoshop Lightroom 5.7 (Macintosh)

For this, try
-if "$Software=~/Adobe Photoshop Lightroom 5/i"

If you're on Mac/Linux swap single/double quotes.

QuoteI don't know what exact command GraphicConverter uses to sync (almost) all metadata dates. Is there an exiftool command that does a similar task?

No idea what they might be doing.  You'd have to ask the author of that app.

QuoteGraphicConverter's copy EXIF date to all other Metadata Dates corrects IFD0:ModifyDate, deletes IPTC dates and corrects and re-arranges and creates new XMP dates:

If you want to go full out along these lines, you could use the the args files that copy between groups.  For example, copy all the EXIF and IPTC data to the XMP group and remove the IPTC group
exiftool -IPTC:all= -@ iptc2xmp.args -@ exif2xmp.args /path/to/files
"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

wywh

#6
Quote from: StarGeek on August 31, 2020, 01:42:31 PM

-if "$IPTC:DateCreated and not $IPTC:TimeCreated"

-if "$Software=~/Adobe Photoshop Lightroom 5/i"

exiftool -IPTC:all= -@ iptc2xmp.args -@ exif2xmp.args /path/to/files

Oh thanks a lot, that seems to do the trick! The first command found hundreds of files with this error and no false positives! The second command found Lightroom 6.5.1, 5.6 and 5.7 files but most of them were OK. But this seems to be some random flaw in Lightroom (I haven't yet checked whether Lightroom 6.14 files are immune to this error).

So now I must find the best way to fix them.

I could not get the last command to work. In the directory where the offending jpg files are it gives an error so obviously I am missing something:

exiftool -IPTC:all= -@ iptc2xmp.args -@ exif2xmp.args .
Error opening arg file iptc2xmp.args


- Matti

StarGeek

Quote from: wywh on August 31, 2020, 02:31:11 PM
I could not get the last command to work. In the directory where the offending jpg files it gives an error so obviously I am missing something:

exiftool -IPTC:all= -@ iptc2xmp.args -@ exif2xmp.args .
Error opening arg file iptc2xmp.args

Oops, sorry, I forgot to provide the link.  You need to download the iptc2xmp.args and exif2xmp.args files and put them in the same directory as exiftool.  You can grab them from GitHub.
"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

wywh

Quote from: StarGeek on August 31, 2020, 02:38:38 PM
iptc2xmp.args and exif2xmp.args

Is this related to the MWG specification? Do current apps support it yet? Or is it still better to use tags that the used app happens to support?

https://exiftool.org/forum/index.php?topic=3065.0

If I want to conform to MWG should I use some sort of a -tagsfromfile command combined with some such *.args file(s)?

- Matti

StarGeek

Quote from: wywh on September 01, 2020, 01:49:30 AM
Is this related to the MWG specification?

That and the IPTC spec and some others.  Details are in the files.

QuoteDo current apps support it yet? Or is it still better to use tags that the used app happens to support?

I don't quite understand the questions.  Support the MWG spec?

Quotehttps://exiftool.org/forum/index.php?topic=3065.0

If I want to conform to MWG should I use some sort of a -tagsfromfile command combined with some such *.args file(s)?

There's no args file to deal with the MWG tag relationships, but there is only about a dozen MWG tags.  The IPTC standard is much more complete with relationships between the IPTC and XMP groups.

The Metadata Working Group (MWG) is pretty much dead at this point.  It's been a couple of years, I think, since their website was active.  Their spec is still useful, though, and can be accessed through the Internet Archive.

The IPTC Photo Metadata Standard is worth looking over as well.
"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