View previous topic :: View next topic |
Author |
Message |
treety
Joined: 11 Jan 2009 Posts: 2
|
Posted: Sun Jan 11, 2009 9:00 pm Post subject: If missing... |
|
|
Is it possible to do something like "if %DateTimeOriginal% (from Image Information) does not exists use %CreationDate% (from File Property)"?
I have a bunch of photos which I want to rename in this fashion <folder>_<DateTimeOriginal>_<counter>.jpg and some photos dont have EXIF data... |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Mon Jan 12, 2009 8:40 am Post subject: |
|
|
Hmmm.
What if you insert both dates to start (datetime original first, then the creation date.
If the datetimetaken date is not present, the default is to insert the %DATETIMEORIGINAL% string.
Then
1)
check which names have 2 dates and eliminate the second one (should not be too difficult with a regex)
2)
check which names have the %DATETIMEORIGINAL% string and get rid of it.
I haven't tried the above yet since it is late but see if that works for you. If you have any trouble then let me know.
Peter. |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Wed Jan 14, 2009 8:20 am Post subject: |
|
|
Hi
Sorry i didn't follow up earlier but it's been very busy.
Forget what I said in the earlier post; it won't work.
There are a couple of ways to do this.
1)
write a plugin - this would allow you to do the renaming in one pass.
or
2)
Do a fairly straight-forward 2 phase renaming.
Follow these steps (read them all first and then try them on a copy of some of your files):
1)
use the options page to configure the date formatter.
press apply.
2)
set up the file properties insertion to insert the date you want for the backup - eg. %LastModifiedDate%
3)
set up the image information insertion to insert the date you want from the tag. e.g. %DateTimeOriginal%
- also format the option for handling missing information so that no errors or warnings are declared. it is vital to keep the 'insert formatcode' option enabled.
4)
Insert the following information into the custom creator (do not include the single quotes):
Row: 1
Search:
Replace: '*Insert Image Information before*All*'
Save this to a custom set - name the set something like 'Add Original DateTime'. This is for future use since you will be changing the configuration in phase 2.
Press Scan and you'll see dates inserted for the files that have exif date tags. For the missing files, they will be prefixed with:
%DateTimeOriginal%
This is the format code.
Now press rename.
This is the end of phase 1
5) - start of phase 2
Replace the name filter with:
%DateTimeOriginal%*
6)
Change the custom creator to the following:
Row: 1
Search:
Replace: '*Insert File Properties before*All*'
Row: 2
Search: '%DateTimeOriginal%'
Replace:
7)
save the configuration to another custom renaming set so that you can reuse it in the future.
Press scan.
The oldname column of the preview window should show all the files that had %DateTimeOriginal% added to their names previously.
The newname column should show the format codes replaced with the file properties dates.
Press rename and you're done.
Hope that helps.
If you have any questions then let me know.
Peter. |
|
Back to top |
|
 |
treety
Joined: 11 Jan 2009 Posts: 2
|
Posted: Sat Jan 17, 2009 7:21 pm Post subject: |
|
|
Sorry, I've been out of town I'll give it a go with two-step...
Edit: Ok, it works, but since I had a different file naming system, so I had extra steps...
Here goes:
1. First step was to do the %DateTimeOriginal% rename, with date from EXIF
Naming filter:*
Row 1: Search: (?E)(.*) #remove previous naming
Row 2: Rename: Insert Counter after Prefix
Row 3: Rename: Insert Image Information before Prefix #option set to %DateTimeOriginal%
Row 4: Rename: Insert Folder before Prefix
Output is like: somefolder_20090101_001.jpg for files with EXIF and somefolder_%DateTimeOriginal%_001.jpg for others
2. Second step Creation Date rename for files without EXIF
Naming filter:*%DateTimeOriginal%_???.???
Row 1: Search: (?E)(.*) #remove previous naming
Row 2: Rename: Insert Counter after Prefix
Row 3: Rename: Insert File Properties before Prefix #option set to %CreationDate%
Row 4: Rename: Insert Folder before Prefix
Output is like: somefolder_20090101_001.jpg
There is probably an easier way, but this finishes business for me. Thanks for help. |
|
Back to top |
|
 |
|