AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

date picture taken

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
bob_C
Guest





PostPosted: Tue May 15, 2007 2:31 pm    Post subject: date picture taken Reply with quote

I am trying to access the "Date Picture Taken" heading in the details view to sort pictures. Not the "Last modified" can someone tell me if this is possible and what the command is.

Like with Last Modified it is.

%A_LoopFileTimeModified%

What is the "Date Picture Taken" version of the above command.

Thanks
Back to top
BETLOG



Joined: 27 Nov 2006
Posts: 218
Location: Queensland, Australia

PostPosted: Tue May 15, 2007 3:26 pm    Post subject: Reply with quote

using FileGetTime?
http://www.autohotkey.com/docs/commands/FileGetTime.htm
Back to top
View user's profile Send private message
Gast (w/ nick)



Joined: 28 Nov 2005
Posts: 14

PostPosted: Tue May 15, 2007 3:49 pm    Post subject: Reply with quote

Once the file is modified, the original data can't be seen by the operating system (to my knowledge)

If your camera stores the date taken in the Exif-Data of the image,
you could look there or google for other exif-reading tools.

http://www.codeproject.com/csharp/exifextractor.asp
Back to top
View user's profile Send private message
Grumpy
Guest





PostPosted: Tue May 15, 2007 5:17 pm    Post subject: Reply with quote

Double post: picture organization
And original proposal was about A_LoopFileTimeCreated, which make more sense (if camera sets it) than A_LoopFileTimeModified...
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5882

PostPosted: Tue May 15, 2007 5:21 pm    Post subject: Re: date picture taken Reply with quote

bob_C wrote:
I am trying to access the "Date Picture Taken" heading in the details view to sort pictures.


If all the photos have been taken from the same camera, post a sample image and I can give you a customised binary function that will extract the Exif date from the file.

Smile
Back to top
View user's profile Send private message
bob_c
Guest





PostPosted: Tue May 15, 2007 5:43 pm    Post subject: Reply with quote

http://www.houseofroettger.com/00017.JPG

They all are from the same camera. Thanks SKAN[/img]
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue May 15, 2007 5:49 pm    Post subject: Reply with quote

Found in the forum: JPEG Metainformation
Thanks BoBo the utility finder!
Correct URL: Exiv2 - Exif and IPTC metadata library and tools
Result:
Code:
output = %A_Temp%\$$ExivOutput$$
RunWait %comspec% /c exiv2 -Pnv E:\Documents\Images\Exif_kodak-dc240.jpg > %output%, , Hide
FileRead exifData, %output%
FileDelete  %output%
; DateTimeOriginal             1999:05:25 21:00:09
RegExMatch(exifData, "m)^DateTimeOriginal\s+(.*)$", date)
MsgBox Photo taken at %date1%

I use the old method of redirecting to a file.
You might prefer to use CMDret, StdoutToVar or Std In/Out/Err via COM
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Last edited by PhiLho on Wed May 16, 2007 9:31 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5882

PostPosted: Tue May 15, 2007 9:20 pm    Post subject: Reply with quote

Try this code along with copies of some pictures taken in different resolution, You should see a MsgBox for each picture.

Well, I am not sure about my code. If you find it does not work for many photos then I will need a couple of more images. Sad

Code:
SetWorkingDir, %A_ScriptDir%

Loop *.jpg
 {
  ImgTime := Kodak( A_LoopFileLongPath )
  If ! ImgTime
     Continue
  FormatTime, Time, %ImgTime%,MMM,dd yyyy [ hh:mm.ss tt ]
  MsgBox, 0, %A_LoopFileName%, % Time

 }


Kodak( file="" ) {
FileRead, binData, *m2048 %file%
P := &binData,  RV := 0

Loop, 2048                     
  If ( *(P+(A_Index-1)) = 0 )
     DllCall( "RtlFillMemory", UInt, P+(A_Index-1), Int,1, UChar,32 )

IfNotInString, binData, KDK0002IDX4530, Return 0

Loop, Parse, binData, `n
   If ( SubStr(A_LoopField,5,1 ) = ":" AND SubStr(A_LoopField,8,1 ) = ":" )
      {
        StringReplace, RV, A_LoopField, %A_Space%,, All
        StringReplace, RV, RV, :,, All
        RV := SubStr( RV, 1, 14 )
      }
Return RV
}


Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group