#1 2016-08-26 09:06

GrahamNZ
Member
Registered: 2016-08-26
Posts: 2

EXIF_Date uses Modified Date Instead of Date Taken to prefix file name

I am having a problem with prefixing my file names with the Date Taken.  I use the EXIF_Date meta tag and for most files, the correct Date Taken is prefixed on the file name.  For some files however, the 'Date Modified' is prefixed instead.  The files are all in the same folder are consecutive on the same days and the correct Date Taken displays in File Explorer for all files.  I have not come across this problem before.  I am using version 6.5.  The same problem occurred in version 6.3 which I have just updated to 6.5.  My other computer does the same thing.  I am using Windows 10 64 bit.  Any assistance would be appreciated.  Thanks.

Offline

#2 2016-08-26 09:57

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: EXIF_Date uses Modified Date Instead of Date Taken to prefix file name

EXIF format is quite versatile and has multiple standard and proprietary locations for storing the date taken. The standard locations are tagged with 'DateTimeOriginal' and 'DateTime' in EXIF structure. That is where ReNamer reads it, in that particular order.

Images can have other meta data streams attached to it, alternatives to standard EXIF. File Explorer might be getting a different date taken from an alternative data stream.

Can you provide a sample image for analysis?

If you can, email it to the email address found in the About dialog.

Offline

#3 2016-08-26 11:11

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: EXIF_Date uses Modified Date Instead of Date Taken to prefix file name

Thanks for sharing the sample image.

After a quick analysis with Exiv2 tool it is clear that your photo does not contain the original EXIF date taken ('DateTimeOriginal' tag). Instead, the true date taken seems to be stored in XMP tags (Xmp.xmp.CreateDate). Unfortunately, ReNamer does not yet understand XMP tags.

There are 2 options:
1) Use some kind of tool to populate the standard EXIF 'DateTimeOriginal' tag.
2) Use PascalScript rule in ReNamer to extract XMP date via exiv2.exe tool.

Here is the full output of "exiv2.exe -pa" command:

Exif.Image.XResolution                       Rational    1  300
Exif.Image.YResolution                       Rational    1  300
Exif.Image.ResolutionUnit                    Short       1  inch
Exif.Image.Orientation                       Short       1  top, left
Exif.Image.YCbCrSubSampling                  Short       1  2
Exif.Image.DateTime                          Ascii      20  2016:08:26 21:03:48
Exif.Image.Make                              Ascii      18  NIKON CORPORATION
Exif.Image.Model                             Ascii      11  NIKON D70s
Exif.Image.Software                          Ascii      40  PaintShop Pro 17.00
Exif.Image.IPTCNAA                           Undefined 151  (Binary value suppressed)
Exif.Image.ExifTag                           Long        1  146
Exif.Photo.ExifVersion                       Undefined   4  2.20
Exif.Photo.PixelXDimension                   Long        1  3008
Exif.Photo.PixelYDimension                   Long        1  2000
Exif.Thumbnail.Compression                   Short       1  JPEG (old-style)
Exif.Thumbnail.XResolution                   Rational    1  72
Exif.Thumbnail.YResolution                   Rational    1  72
Exif.Thumbnail.ResolutionUnit                Short       1  inch
Exif.Thumbnail.JPEGInterchangeFormat         Long        1  538
Exif.Thumbnail.JPEGInterchangeFormatLength   Long        1  8753
Xmp.xmpMM.InstanceID                         XmpText    41  uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b
Xmp.tiff.Model                               XmpText    10  NIKON D70s
Xmp.tiff.Make                                XmpText    17  NIKON CORPORATION
Xmp.tiff.ResolutionUnit                      XmpText     1  inch
Xmp.tiff.YResolution                         XmpText     5  300
Xmp.tiff.XResolution                         XmpText     5  300
Xmp.tiff.YCbCrPositioning                    XmpText     1  Co-sited
Xmp.tiff.Orientation                         XmpText     1  top, left
Xmp.tiff.NativeDigest                        XmpText   134  256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;E395E835C84AF22B00E11CAE4216A91B
Xmp.tiff.ImageLength                         XmpText     4  2000
Xmp.tiff.ImageWidth                          XmpText     4  3008
Xmp.xmp.ModifyDate                           XmpText    25  2016-08-26T21:03:48+13:00
Xmp.xmp.CreatorTool                          XmpText    19  PaintShop Pro 17.00
Xmp.xmp.CreateDate                           XmpText    27  2013-12-01T09:38:18.7+13:00
Xmp.exif.ExifVersion                         XmpText     4  2.20
Xmp.exif.PixelYDimension                     XmpText     4  2000
Xmp.exif.PixelXDimension                     XmpText     4  3008
Xmp.exif.NativeDigest                        XmpText   414  36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;09C5ED1D1BE0AD291DC89BFCF3D7CC13
Xmp.mwg-rs.Regions                           XmpText     0  type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions XmpText     0  type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:w XmpText     4  3008
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:h XmpText     4  2000
Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:unit XmpText     5  pixel
Xmp.mwg-rs.Regions/mwg-rs:RegionList         XmpText     0  type="Bag"
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]      XmpText     0  type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Name XmpText     4  Alex
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Type XmpText     4  Face
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area XmpText     0  type="Struct"
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:x XmpText     8  0.422706
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:y XmpText     5  0.425
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:w XmpText     9  0.0355718
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:h XmpText     5  0.064
Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:unit XmpText    10  normalized

Offline

#4 2016-08-26 11:27

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: EXIF_Date uses Modified Date Instead of Date Taken to prefix file name

If you would like to go with the second option, then you need to download Exiv2 tool and unpack it into the same folder as ReNamer.exe.

Then, add a PascalScript rule with the following code below.

It extracts the date from 'Xmp.xmp.CreateDate' tag, reformats it and add it to the beginning of the filename using the same date format as in your example (yyyymmdd-hhmmss_).

const
  ExtractDateCommand = 'exiv2.exe -g Xmp.xmp.CreateDate -Pv -q';
  DatePatternFind = '.*?(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*';
  DatePatternReplace = '$1$2$3-$4$5$6_';
var
  Command, Output, Date: String;
begin
  Command := ExtractDateCommand + ' "' + WideToAnsi(FilePath) + '"';
  if ExecConsoleApp(Command, Output) = 0 then
  begin
    Output := Trim(Output);
    Date := ReplaceRegEx(Output, DatePatternFind, DatePatternReplace, False, True);
    if Date <> Output then
      FileName := Date + FileName;
  end;
end.

Offline

#5 2016-08-27 00:46

GrahamNZ
Member
Registered: 2016-08-26
Posts: 2

Re: EXIF_Date uses Modified Date Instead of Date Taken to prefix file name

Thank you for the information.  I recall now that Corel PaintShop Pro clears the Date Taken field for some reason and for that reason I normally rename before editing.  These files are some leftovers.  I will have a look at the Pascal and may contact you separately about using it.

Offline

Board footer

Powered by FluxBB