View previous topic :: View next topic |
Author |
Message |
s31415
Joined: 24 Jan 2009 Posts: 9
|
Posted: Sat Jan 24, 2009 3:27 am Post subject: Arithmetic and subfolder dependent rule |
|
|
Hi,
Is it possible to perform arithmetic operations on numbers appearing in filnames ? For instance change
file1.jpg
file2.jpg
file3.jpg
...
to
file2.jpg
file3.jpg
file4.jpg
...
?
Also, how can I create a rule that will be applied only to a specific subfolder ?
Thanks in advance and best regards,
Sam |
|
Back to top |
|
|
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sat Jan 24, 2009 6:26 am Post subject: |
|
|
Yes to both questions.
For the first one you need a plugin. There is already an example plugin called "PFrank_Add1.1ToFirstNumber_Plugin.py".
Just change the code to add 1 instead of 1.1.
The plugin and information on using plugins is at:
http://www3.telus.net/pfrank/PFrankUserCommand.html
Further instructions are in the plugin file.
For the second question, just press the "more' button on the main window. This wil cause the Options window to pop up. In that window you'll find a filter for subfolders. Just set that filter to the subfolder name (or pattern) you want.
If you need more info then let me know.
Peter. |
|
Back to top |
|
|
s31415
Joined: 24 Jan 2009 Posts: 9
|
Posted: Sat Jan 24, 2009 3:32 pm Post subject: |
|
|
Thanks you very much ! I'll study this.
Sam |
|
Back to top |
|
|
s31415
Joined: 24 Jan 2009 Posts: 9
|
Posted: Sun Jan 25, 2009 5:14 am Post subject: |
|
|
Hi again,
Two more questions :
- Is it possible to write plugin with parameters ? For instance a plugin that would add n to the first number appearing in the file, where n would be a number provided by the user in PFrank.
- Concerning subfolder, maybe I misunderstood your answer, but it seems that by setting a filter in the "more" button, this will apply to all the search patterns. I would have liked to have search and replacement patterns that apply to different subfolders... Maybe it is also possible to do this with a plugin ?
Sorry to bore you with such strange renaming requirements... No need to read further, but if you're curious about why I need this, I'm trying to convert in Zoomify (http://www.zoomify.com) an image of size 65536 x 65536 pixels which is broken into 64 8192 x 8192 tiles. Zoomify is a flash plugin which allow you to explore huge images just like in Google Maps by breaking them into 256 x 256 tiles at various scales. Each tile should be named a-b-c.jpg, with a a number representing the scale, b the x coordinate and c the y coordinate. Zoomify provides utility performing this, but it accepts as input only one large image. As my 65536 x 65536 pixel image broken into tiles, and as my computer would die if I tried to assemble these tiles, I have to pass the tiles separately into Zoomify, and rename them appropriately.
Thanks,
Sam |
|
Back to top |
|
|
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sun Jan 25, 2009 9:19 pm Post subject: |
|
|
I'll answer the second question first:
- what you could do is ue the list manager feature (on the main window). With the list manager you can save the custom creator list plus all the filters into a named configuration set. With this you can specify configurations that use different subfolder filters.
For the first question:
GUI or other parameters being passed into a plugin is currenlty not a feature. But you can spoof it by borrowing a parameter that you might not be using. In this case a name filter parameter might work because filter parameters can be saved in a custom set (from (1) above.
For example, you can access the "min path length" parameter from a plugin. The variable is called:
configurator.optionlist[SEARCHREP_OPTIONMINPATHLENGTH_ID]
or maybe use the max subfolder depth parameter:
configurator.optionlist[SEARCHREP_OPTIONMAXSUBFOLDERS_ID]
These variables are both integers and are saved for each custom set. The range of these particular variables are limited (to a max of 512) so I don't know if that will work for you but you can always combine them if you need more range.
It is not an idelal soluton but should work.
I'll think about adding custom variables as a future feature.
Hope this works. If you find some other problem or limitation then let me know.
Peter. |
|
Back to top |
|
|
s31415
Joined: 24 Jan 2009 Posts: 9
|
Posted: Sun Jan 25, 2009 11:37 pm Post subject: |
|
|
About the subfolders, I will have one for each of my 64 tiles. In each of them, the renaming pattern should be different. I was wondering if I could avoid hitting 64 times the "scan" button... I may avoid it if I can execute several lists altogether. Is it possible ? But it's only pure laziness...
Passing the parameters through the configurator works well !
Thanks again !
Sam |
|
Back to top |
|
|
s31415
Joined: 24 Jan 2009 Posts: 9
|
Posted: Mon Jan 26, 2009 12:03 am Post subject: |
|
|
Ah, one more question. How can I access the "max name length" parameter ? The obvious
configurator.optionlist[SEARCHREP_OPTIONMAXNAMELENGTH_ID]
doesn't seem to work...
Sam |
|
Back to top |
|
|
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Mon Jan 26, 2009 2:35 am Post subject: |
|
|
The parameter you want is called:
configurator.optionlist[SEARCHREP_OPTIONMAXFILELENGTH_ID]
Are the parent folder names of the tiles related in any way to how you want to rename the files under them. If so there is an 'insert parent folder name' option that might be of use.
Peter. |
|
Back to top |
|
|
s31415
Joined: 24 Jan 2009 Posts: 9
|
Posted: Tue Jan 27, 2009 5:34 am Post subject: |
|
|
I will have to think a bit more to see if I can use the name of the folders... But anyway thanks !
Sam |
|
Back to top |
|
|
|