Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (http://www3.telus.net/pfrank)
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

If missing...

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions
View previous topic :: View next topic  
Author Message
treety



Joined: 11 Jan 2009
Posts: 2

PostPosted: Sun Jan 11, 2009 9:00 pm    Post subject: If missing... Reply with quote

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
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Mon Jan 12, 2009 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Wed Jan 14, 2009 8:20 am    Post subject: Reply with quote

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.

Cool
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
View user's profile Send private message Send e-mail Visit poster's website
treety



Joined: 11 Jan 2009
Posts: 2

PostPosted: Sat Jan 17, 2009 7:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com