• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Photograph MetaData Time of shot script

Enthusiast ,
Jun 23, 2009 Jun 23, 2009

Copy link to clipboard

Copied

Can I ask how to script a routine that reads the time a photograph was taken either from creation or from metadata in image file and saves file with this time as filename. Then I can create an intelligent dissolve sequence automation in some other application, prob QC. On Mac so Applescript okay but me !== good at applescript would be a fair call.

My Javascript is getting there but don't know the metadata calls or file properties either.

Appreciation in advance

TOPICS
Actions and scripting

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Enthusiast ,
Jun 23, 2009 Jun 23, 2009

Copy link to clipboard

Copied

I looked at another thread re bridge and creation dates and taken dates and so on. As these files have been processed into .dng files the file creation dates are useless (accept for order which is in file name already). I need to pull info which I cannot find in Bridge or Aperture but can find in Photoshops File Info Panel under Camera Data (1) Tab. Good ol' PS!

It is the actual date-time of the shot not file copy date-time like all the other data IPTC EXIF General Info etc is.

SO that's what I need to get out with a script into either a list I can make XML or into the filename.

Anybody. A bit of help is better than nothing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 23, 2009 Jun 23, 2009

Copy link to clipboard

Copied

exif:DataTimeOriginal is probably the one you want. Try

exiftool -XMP filename.jpg -b | grep Date

to get a full list of date property names and values and work from there.

-X

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 23, 2009 Jun 23, 2009

Copy link to clipboard

Copied

Here is how to get the date with Photoshop CS4

function loadXMPLibrary(){
     if ( !ExternalObject.AdobeXMPScript ){
          try{
               ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
          }catch (e){
               alert("Can't load XMP Script Library");
               return false;
          }
     }
     return true;
}
loadXMPLibrary();
var docXMP = new XMPMeta( app.activeDocument.xmpMetadata.rawData );
var date = docXMP.getProperty( XMPConst.NS_EXIF, "DateTimeDigitized" );// or "DateTimeOriginal" they are the same with my test files

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 05, 2009 Jul 05, 2009

Copy link to clipboard

Copied

Hi sorry to take so long getting back to you both.

That script looks a bit unfamiliar (given to the novice stuff I do). I'll have a shot at scripting it tomorrow. I was looking at the XMP raw in PS last week and found the data record that PS is probably getting the date_time from:

   <exif:DateTimeOriginal>2007-04-14T17:54:02+10:00</exif:DateTimeOriginal>

It's only accurate to seconds which is pretty crap given modern SLRs can shoot many FPS. Given how overspec'd most data-points are these days it seems an odd oversight from XMP boffins.

Thanks for the script line/s.

Best

Alastair

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 05, 2009 Jul 05, 2009

Copy link to clipboard

Copied

It's only accurate to seconds which is pretty crap given modern SLRs can shoot many FPS. Given how overspec'd most data-points are these days it seems an odd oversight from XMP boffins.

You're wrong.  The XMP spec will accept Date values to (implied) abritrary precision. If your camera doesn't spit out anything thing with finer resolution than seconds, it's a problem with your camera vendor, not the spec.

Here's the relevant bit from the XMP spec:

Date
A date-time value which is represented using a subset of ISO RFC 8601 formatting, as described in
http://www.w3.org/TR/Note-datetime.html. The following formats are supported:


YYYY
YYYY-MM
YYYY-MM-DD
YYYY-MM-DDThh:mmTZD
YYYY-MM-DDThh:mm:ssTZD
YYYY-MM-DDThh:mm:ss.sTZD


YYYY = four-digit year
MM   = two-digit month (01=January)
DD   = two-digit day of month (01 through 31)
hh   = two digits of hour (00 through 23)
mm   = two digits of minute (00 through 59)
ss   = two digits of second (00 through 59)
s    = one or more digits representing a decimal fraction of a second
TZD  = time zone designator (Z or +hh:mm or -hh:mm)

The time zone designator is optional in XMP. When not present, the time zone is unknown, and software
should not assume anything about the missing time zone.
It is recommended, when working with local times, that you use a time zone designator of +hh:mm or
-hh:mm instead of Z, to aid human readability. For example, if you know a file was saved at noon on
October 23 a timestamp of 2004-10-23T12:00:00-06:00 is more understandable than
2004-10-23T18:00:00Z.

-X

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 05, 2009 Jul 05, 2009

Copy link to clipboard

Copied

Thanks xbytor2

I stand corrected. I guess it was an oversight by Olympus Corperation. Camera was an E-1 and not mine for the record.

wideEyedPupil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 06, 2009 Jul 06, 2009

Copy link to clipboard

Copied

LATEST

If you just want to determine the order the images where shot you may want to check to see if your files have the metadata 'aux:ImageNumber'. With my Nikon that number is the number of images the camera has taken. It can not be reset in the camera like the filename can.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines