Harlequin Posted December 31, 2008 Posted December 31, 2008 What it does: Renames media files (jpg, jpeg, bmp, mpg, mpeg, png, gif, tif, tiff, avi, flc) based on their date, so in the directories, they will show up in order, and not duplicate names, etc. It Looks first at the standard Digital EXIF data, and uses that for the file name. If that is absent, then it looks to the file creation date. If that is absent, it will give the file a date & time of all "0"'s (0000-00-00_###, etc.) Files are all appended with a 3 digit number, so files with the same date (& time) would be named, for example: YYYY-MM-DD_HH_MM_SS_###.ext 2008-12-07_14-22-55_001.jpg, 2008-12-07_14-22-55_002.jpg,...2008-12-07_14-22-55_999.jpg OR: YYYY-MM-DD_###.ext 2008-12-07_001.jpg, 2008-12-07_002.jpg,...2008-12-07_999.jpg It DOES NOT check across directories, so in 2 directories, files can end up with the same name, but within the SAME directory they can NOT.ExifTool.au3 But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security. - U.S. Declaration of Independence
gseller Posted January 1, 2009 Posted January 1, 2009 (edited) Looks intresting, I will have to try it out.. Thank you for sharing.edit: Tried it.. Awesome! Very nice work.. Keep it up.. Edited January 1, 2009 by gseller
dansxmods Posted January 1, 2009 Posted January 1, 2009 Just gave it a go and I like it. Good work mate.
FireFox Posted January 1, 2009 Posted January 1, 2009 @Harlequin Nice work btw, can you make 'back' option because after done that Ive renamed files in a folder I didnt want to; I renamed all files Idea for back option : write all back names and new names in a file Cheers, FireFox.
tmax Posted April 20, 2009 Posted April 20, 2009 Hi, Very nice! Pls try my simple code conversion from my vb script "ExifDate.vbs". Drag Drop JPG file(s) and rename to Timestamp of Exif Date / File Modified Date. CODE#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=ExifDate.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; ExifDate.au3 ; Author TMax #include <file.au3> local $szDrive, $szDir, $szFName, $szExt Local $FileSave, $FilePath, $FileDate, $Files, $fContents Local $t, $Ret Local $lExif, $lColon $Files = $CmdLine For $i = 1 To $Files[0] $FilePath = _PathSplit($Files[$i] , $szDrive, $szDir, $szFName, $szExt) If StringUpper($FilePath[4]) <> ".JPG" then ExitLoop $fContents = FileRead ($Files[$i], FileGetSize ($Files[$i])) $lExif = StringInStr ($fContents, "Exif") if $lExif > 0 then $lColon = StringInStr ($fContents, ":") If $lColon > 0 and StringMid($fContents, $lColon + 3 , 1) = ":" Then $FileDate = StringMid($fContents, $lColon - 4, 19) $FileDate = StringReplace($FileDate, ":", "-") EndIf Else $t=FileGetTime($Files[$i],1) $FileDate= $t[0] &"-" & $t[1] & "-" & $t[2] & " " & $t[3] & "-" & $t[4] & "-" & $t[5] EndIf $FileSave=$FilePath[1] & $FilePath[2] & $FileDate & $FilePath[4] If $FileSave=$FilePath[3] Then ExitLoop If FileExists ($FileSave) Then $Ret=MsgBox(256+4+64,"Confirm File Rename","This folder already contains a file named '" & $FileDate &"'." & _ @CRLF & @CRLF & "Would you like to rename the existing file with " & @CRLF & $FileDate & "~c" ) if $Ret=6 then FileMove($files[$i],$FilePath[1] & $FilePath[2] & $FileDate & "~c" & $FilePath[4]) ;diff name with "~c" Else FileMove($Files[$i],$FileSave) EndIf Next
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now