News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Date and tag problems

Started by UlfT, March 13, 2017, 06:09:11 PM

Previous topic - Next topic

UlfT

Hi
I'm cleaning up on old sins and have a couple of thousand files where there is no date for when the pic was taken.
Accidentally it does correspond to the date chanegd (something that has been commented in several posts here).
However - when i try to populte that date into "Date Taken", it fails.
From what I've figured out, the Exif tag isn't there and despite trying several of the tips here I get no luck.
The files produce this:

F:\>exiftool -a -G1 -s F:\fixa\1.jpg
[ExifTool]      ExifToolVersion                 : 10.46
[System]        FileName                        : 1.jpg
[System]        Directory                       : F:/fixa
[System]        FileSize                        : 67 kB
[System]        FileModifyDate                  : 2012:06:28 20:54:16+02:00
[System]        FileAccessDate                  : 2017:03:13 21:57:22+01:00
[System]        FileCreateDate                  : 2017:03:13 21:57:22+01:00
[System]        FilePermissions                 : rw-rw-rw-
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Big-endian (Motorola, MM)
[File]          ImageWidth                      : 640
[File]          ImageHeight                     : 426
[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                  : inches
[JFIF]          XResolution                     : 0
[JFIF]          YResolution                     : 0
[ICC-header]    ProfileCMMType                  : Lino
[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              : IEC
[ICC-header]    DeviceModel                     : sRGB
[ICC-header]    DeviceAttributes                : Reflective, Glossy, Positive, Color
[ICC-header]    RenderingIntent                 : Media-Relative Colorimetric
[ICC-header]    ConnectionSpaceIlluminant       : 0.9642 1 0.82491
[ICC-header]    ProfileCreator                  : HP
[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
[ExifIFD]       ExifImageWidth                  : 640
[ExifIFD]       ExifImageHeight                 : 426
[Composite]     ImageSize                       : 640x426
[Composite]     Megapixels                      : 0.273

F:\>

How can I add the "DateTimeOriginal" and/or the "CreateDate" tag to the file?
I'm guessing that to get the date over I would then need to do:
ExifTool -v "-FileModifyDate>DateTimeOriginal" F:\1.jpg

Tired beginner.....

StarGeek

Quote from: UlfT on March 13, 2017, 06:09:11 PM
However - when i try to populte that date into "Date Taken", it fails.

That's because there is no such thing as a Date Taken tag.  It's a Windows property that's populated by various tags depending upon what Windows finds.  See this thread for more info.

QuoteHow can I add the "DateTimeOriginal" and/or the "CreateDate" tag to the file?
I'm guessing that to get the date over I would then need to do:
ExifTool -v "-FileModifyDate>DateTimeOriginal" F:\1.jpg

That command would work.  You don't need the -v unless you want to look at the various details of what Exiftool is doing.  To get the CreateDate tag filled as well, you could add "-CreateDate<FileModifyDate" to the command.  In both cases, the tag copy follows the direction of the Greater/Less Than symbol, so you can use either way. 
* 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).

UlfT

Hi

Well I've tried that approach but had no luck

F:\>exiftool -v -p "-FileModifyDate>DateTimeOriginal" F:\fixa\1.jpg
  ExifToolVersion = 10.46
  FileName = 1.jpg
  Directory = F:/fixa
  FileSize = 68984
  FileModifyDate = 1340909656.32358
  FileAccessDate = 1489438642.13287
  FileCreateDate = 1489438642.13287
  FilePermissions = 33206
  FileType = JPEG
  FileTypeExtension = JPG
  MIMEType = image/jpeg
JPEG APP0 (14 bytes):
  + [BinaryData directory, 9 bytes]
  | JFIFVersion = 1 1
  | ResolutionUnit = 1
  | XResolution = 0
  | YResolution = 0
JPEG APP2 (3158 bytes):
  ICC_Profile chunk 1 of 1
  + [ICC_Profile directory with 17 entries, 3144 bytes]
  | ProfileHeader (SubDirectory) -->
  | + [BinaryData directory, 128 bytes]
  | | ProfileCMMType = Lino
  | | ProfileVersion = 528
  | | ProfileClass = mntr
  | | ColorSpaceData = RGB
  | | ProfileConnectionSpace = XYZ
  | | ProfileDateTime = 1998 2 9 6 49 0
  | | ProfileFileSignature = acsp
  | | PrimaryPlatform = MSFT
  | | CMMFlags = 0
  | | DeviceManufacturer = IEC
  | | DeviceModel = sRGB
  | | DeviceAttributes = 0 0
  | | RenderingIntent = 1
  | | ConnectionSpaceIlluminant = 0.9642 1 0.82491
  | | ProfileCreator = HP
  | | ProfileID = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  | 0)  ProfileCopyright = Copyright (c) 1998 Hewlett-Packard Company
  | 1)  ProfileDescription = sRGB IEC61966-2.1
  | 2)  MediaWhitePoint = 0.95045 1 1.08905
  | 3)  MediaBlackPoint = 0 0 0
  | 4)  RedMatrixColumn = 0.43607 0.22249 0.01392
  | 5)  GreenMatrixColumn = 0.38515 0.71687 0.09708
  | 6)  BlueMatrixColumn = 0.14307 0.06061 0.7141
  | 7)  DeviceMfgDesc = IEC http://www.iec.ch
  | 8)  DeviceModelDesc = IEC 61966-2.1 Default RGB colour space - sRGB
  | 9)  ViewingCondDesc = Reference Viewing Condition in IEC61966-2.1
  | 10) ViewingConditions (SubDirectory) -->
  | + [BinaryData directory, 36 bytes]
  | | ViewingCondIlluminant = 19.6445 20.3718 16.8089
  | | ViewingCondSurround = 3.92889 4.07439 3.36179
  | | ViewingCondIlluminantType = 1
  | 11) Luminance = 76.03647 80 87.12462
  | 12) Measurement (SubDirectory) -->
  | + [BinaryData directory, 36 bytes]
  | | MeasurementObserver = 1
  | | MeasurementBacking = 0 0 0
  | | MeasurementGeometry = 0
  | | MeasurementFlare = 0.00999
  | | MeasurementIlluminant = 2
  | 13) Technology = CRT
  | 14) RedTRC = curv.......#(-27;@EJOTY^chmrw|......................................%.[snip]
  | 15) GreenTRC = curv.......#(-27;@EJOTY^chmrw|......................................[snip]
  | 16) BlueTRC = curv.......#(-27;@EJOTY^chmrw|......................................%[snip]
JPEG APP1 (64 bytes):
  ExifByteOrder = MM
  + [IFD0 directory with 1 entries]
  | 0)  ExifOffset (SubDirectory) -->
  | + [ExifIFD directory with 2 entries]
  | | 0)  ExifImageWidth = 640
  | | 1)  ExifImageHeight = 426
JPEG DQT (65 bytes):
JPEG DQT (65 bytes):
JPEG SOF0 (15 bytes):
  ImageWidth = 640
  ImageHeight = 426
  EncodingProcess = 0
  BitsPerSample = 8
  ColorComponents = 3
JPEG DHT (29 bytes):
JPEG DHT (179 bytes):
JPEG DHT (29 bytes):
JPEG DHT (179 bytes):
JPEG SOS
-FileModifyDate>DateTimeOriginal

F:\>exiftool -time:all -a -G0:1 -s F:\fixa\1.jpg
[File:System]   FileModifyDate                  : 2012:06:28 20:54:16+02:00
[File:System]   FileAccessDate                  : 2017:03:13 21:57:22+01:00
[File:System]   FileCreateDate                  : 2017:03:13 21:57:22+01:00
[ICC_Profile:ICC-header] ProfileDateTime        : 1998:02:09 06:49:00

F:\>

When I compare that output to the output I get from a file that "works", the content is much more verbose and contains the dates I want to exist in 1.jpg:

:\>exiftool -time:all -a -G0:1 -s F:\2.jpg
[File:System]   FileModifyDate                  : 2017:02:08 10:35:46+01:00
[File:System]   FileAccessDate                  : 2017:03:14 08:10:31+01:00
[File:System]   FileCreateDate                  : 2017:03:14 08:10:31+01:00
[EXIF:IFD0]     ModifyDate                      : 2017:02:08 10:35:46
[EXIF:ExifIFD]  DateTimeOriginal                : 2017:02:08 10:35:46
[EXIF:ExifIFD]  CreateDate                      : 2017:02:08 10:35:46
[EXIF:ExifIFD]  SubSecTimeOriginal              : 851
[EXIF:ExifIFD]  SubSecTimeDigitized             : 851
[EXIF:GPS]      GPSTimeStamp                    : 09:35:46
[EXIF:GPS]      GPSDateStamp                    : 2017:02:08
[Composite]     GPSDateTime                     : 2017:02:08 09:35:46Z
[Composite]     SubSecCreateDate                : 2017:02:08 10:35:46.851
[Composite]     SubSecDateTimeOriginal          : 2017:02:08 10:35:46.851

F:\>


StarGeek

Quote from: UlfT on March 14, 2017, 03:13:26 AM

F:\>exiftool -v -p "-FileModifyDate>DateTimeOriginal" F:\fixa\1.jpg

The error here is that you've added the -p option which takes the next part of the command as the format to print the output.  I suspect you meant to use -P.
* 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).

UlfT

Fantastic!!!!  ;D

I thought I read somewhere that it was case insensitive so I never reflected over that.
I'll get it chewing the files now and see where I end up

Thanks a million!

UlfT

Hi

It worked for all the JPG but not the PNG's.
What I'm trying to do is a PowerShell scripts that sorts all the files into a hierarchy and for some reason the PNG files get a "DateTaken" that is visible in Windows Explorer.
But the .GetPropertItem(36867) cannot find any date to pick up and hence pile all PNG's in a exception folder I created.
So how do i figure out either how to put the date in the right PropertyItem or get what ID PNG stores the date under?

StarGeek

Refer back to the link I posted above.  Windows reads a different tag for PNG files.
* 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).

UlfT

Yes - there are a few  ;) and I read through the link and the sublinks.
But I tried doing a:
ExifTool -P "-FileModifyDate>AllDates" F:\001.png
and also a
ExifTool -P "-FileModifyDate>PNG:CreationTime" F:\001.png
and the result says in both cases that "1 image file updated" but still the PowerShell .GetProperty can't pick up any date anywhere so it just drops the file in my \Exception folder.

So my understanding of this (I'm not a coder, just a cruncher) is that I either have to create the right PropertyID (being 36867) in the PNG file or get the ID of the PNG:CreationTime.
Or is there some other cool switch in ExifTool that does the magic?
(I'm still baffled by how one can poke around and alter things in the image file without any Visual alterations, but I guess the actual Visual isn't all the bytes in the file)

(edit) and here is a nother link that discusses just about the same thing http://photo.stackexchange.com/questions/64552/is-date-taken-exif-data-possible-on-png-file-and-is-it-possible-to-copy-dat

StarGeek

The AllDates tag will modify three EXIF tags (DateTimeOriginal, CreateDate, ModifyDate) but the PNG format doesn't officially support EXIF metadata (yet... I hear an official spec is coming).  Exiftool will write EXIF metadata in a non-standard location but that isn't supported by Windows.

PNG:CreationTime is where the Date Taken Windows property is read from, but unfortunately, you're on your own with dealing with PowerShell.

Quote from: UlfT on March 14, 2017, 05:54:24 PM(edit) and here is a nother link that discusses just about the same thing http://photo.stackexchange.com/questions/64552/is-date-taken-exif-data-possible-on-png-file-and-is-it-possible-to-copy-dat

Yep, I answered that post :) 
* 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).

UlfT

OK - so a little searching around and thinking!
This led to http://nicholasarmstrong.com/2010/02/exif-quick-reference/ (Credits ExifTool but also list the Decimal values for the PropertyID) and a minor change of the PowerShell script to use 306 instead of 36867 cracked the PNG riddle.

Still I'm not clear of a way to list all the Hex/Decimal values for the PropertyID's.
All references I've found so far talk about Visual Studio, but that is a bit too far for me.
There is a half victory in the PowerShell "Get-ItemProperty Picture.png |Select *" that lists some of them but NOT all (and not in Hex or Dec) as the Windows Explorer reveals other dates that are not listed.
This seems to be a very messy World that require case by case solutions.

Phil Harvey

Quote from: UlfT on March 15, 2017, 05:53:46 AM
(Credits ExifTool but also list the Decimal values for the PropertyID)

Just FYI:  The ExifTool Tag Name documentation also lists decimal tag ID's -- just hover over the hex number to see the decimal value.  Also the exiftool -D option lists decimal ID's for metadata in a file, and the -H option lists them in hex.

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

UlfT

Thanks for those switches Phil - If I had known them from the start I would probably have saved a day or two :-)
I Think ExifTool is probably one of the more complete pieces of software I've dealt with over the years. It's so rich in features that it's hard to grasp  :)