Page 1 of 1

File Utilities - Import, rename, and copy

PostPosted: Wed May 15, 2013 5:59 am
by tstoddard
I'm new to FPV and am struggling to do something that I'd like to do. I want to incorporate FPV into my workflow as the first step in ingesting my raw files from my camera's memory card onto my desktop pc. I love the speed and ease with which I can cull my set of images but I want to reduce my steps to as few as possible. Here is what I'd like to accomplish:

1. Don't touch the files on the memory card. Call me paranoid but until I'm satisfied that my files are safely imported to my pc and backed up onto my external hard drive, I don't want to write to or delete anything on my memory card.
2. I want to cycle through all images and select the pictures that I want to keep or the ones that I don't want to keep.
3. I want to copy the files to a folder on my hard drive using a template that creates the desired directories and directory structure and I want the destination files to be renamed using a naming rule that results in unique file names.
4. I want to make copies of the same files on my external hard drive with the exact same names and directory structure that they have on my internal hard drive.
5. I want to do steps 3 and 4 with one click of the apply button in the file utilities plugin.

I know how to accomplish all of these goals but I'm not able to accomplish 3 and 4 with one click. I need to use a counter in order to guarantee a unique file name and if I copy the files from my memory card twice, once to each destination, the files will have different names. If I rename them before copying them, the memory card will get written to. I can probably copy them once to my hard drive then switch to that folder as my image folder and then copy them again, without renaming them, to my external hard drive but this requires several steps.

There is an example of doing something similar to this in the documentation but it uses the "move" function which deletes the images from the memory card. which I don't want to do. The example rule shown would also result in different file names if I use a counter in my rename template.

Is what I want to do possible? Is it unreasonable?

Re: File Utilities - Import, rename, and copy

PostPosted: Wed May 15, 2013 10:48 pm
by Axel
The scenario you describe is perfectly reasonable. The only "point of friction" is that your renaming template uses an auto-incrementing counter, and when you run two or more similar copy rules (with different copy destinations), with the renaming template containing the same auto-counter, the counter will indeed be incremented for each copy operation and that part of the resulting file name will be different.

If the camera-generated number, as in DSC_0001.jpg is good enough for your scenario, it is possible to use it as your unique number in place of the auto-incrementing counter.

A regular expression can relatively easily dissect the name: for example extract the last 4 digits, or extract digits wherever they are within the name, that you can then paste into the new name, where you want them. Once you have this new renaming template in place, copying with the complex renaming, to multiple simultaneous locations, is just a matter of copying the rule as many time as needed, changing the copy destinations, and there you are: one-click batch import and multi-copy-with-rename! 8-)

If you want to try this please post an example of source and destination file names that you use and the renaming template that you created to accomplish the transformation, and I'll gladly show you how to modify the template to use the numbers from the original image file name, or - even simpler - if your camera fills it up in the EXIF information, the {FileNumber} predefined substitution variable will do the trick! You could probably simple replace the auto-increment variable that you used in your test with {FileNumber:1} and be done.

The field is present on most Canon and Nikon files, and you'll find it, along with it's sibling {FolderNumber:1} that you'll find in the "Insert Substitution Variable -> Image Info" right-click context menu everywhere a substitution variable is accepted).

Their cousin, {FileNameHash}, is also a number (coded in hexadecimal, so it contains some letters) derived from the original file name, that can be used to generate "uniquizers" in destination names and which is also invariant with regard to the number of copies that your rule(s) performs.

Finally, while I understand your concerns about not modifying the data on card, a rename operation is guaranteed not to modify the image data or metadata, since it's strictly a file-system operation that does not touches the files at all. The only quirk that comes to mind is the (possible) DOS "8.3" name format limitation that may be in effect on the card itself - to be tested - but a rule set composed of a rename rule, possibly containing an auto-increment counter, followed by two or more copy rules will neatly accomplish what you want.

Let us know if you find a way that works for you. If not, I already thought of a new {ImageIndex} variable that I could add in a future version and that would represent the "N of NNN" image number in the current image list, that will be unique within a given batch session and invariant with regard to the rename/copy operations they may be performed by the rules you run...

Re: File Utilities - Import, rename, and copy

PostPosted: Thu May 16, 2013 5:00 am
by tstoddard
Thank you for the thorough response. I'm sure I can find a way to make this work. Using the filenumber is probably the simplest solution.

If you are considering adding a feature in a future version that would help to accomplish this in an intuitive manner, please consider adding mirroring functionality to the copy action. Perhaps a "Mirror to folder" option could be added to the Configure Copy Action dialog. It could be a check box with an accompanying text box into which a second destination could be entered. I'm not a professional programmer but I would guess that it would be relatively easy and efficient to just copy the destination file to two locations instead of running two separate copy actions.

The feature, if implemented as I've suggested, would be somewhat hidden. It might be helpful to describe the action as: "Copy it to the destination folders or folders".

Of course it is your program. I'm just making a friendly suggestion. I can work with the program as it is.

Thanks again!

Re: File Utilities - Import, rename, and copy

PostPosted: Thu May 16, 2013 12:26 pm
by Axel
I see where you are coming from :-)

Different programs have different ways of accomplishing the same things and I found the "checkbox-and-second-destination" approach, found in another product, to be too rigid: what if you want to copy the files to three locations? Or four?

Okay it probably does not make sense to duplicate files to twenty different places, but three certainly does (internal HDD, external USB-attached drive and a file server is common, for example).

The approach taken with FPV offers the most flexibility: just add as many rules with Copy actions as you need, no matter how many.

Sometimes the separate rules that copy your files will have different executions conditions (for example on file types: JPEGs here and RAWs there comes to mind, or on image orientation - portraits there and landscape here etc etc) that other approaches have much trouble accommodating.

You can also copy the file to some place, then move the original to another place in a separate, last rule, setting the error condition on the first rule(s) to interrupt the operation in case of a problem, so the file will not be moved if the copy failed, or if the bit-by-bit, read-after-write copy verification indicated a problem with any of the file copies.

I understand how it's tempting to look for the features one might be accustomed to in another application, but sometimes a slight disruption opens the door to far more flexibility.

Anyway, you have a point: there is no obvious way to create mirror copies when the copy action also renames files and the rename template includes an auto-incrementing counter.

That's a pretty narrow case but I'll add a variable as described, that will solve this very issue by providing a session-unique image number that is not derived from the file itself and which can be reused across different rules and actions on the same file, which is exactly what you need to perform multiple auto-renamed copies containing a sequence number unique within the image set.

As a bonus, this counter will auto-reset (the first image will always be 1 every time you run the plugin), and the numeric sequence will reflect the current sort order so if you sort by reverse-time the image #1 will be the last taken etc.

Re: File Utilities - Import, rename, and copy

PostPosted: Thu May 16, 2013 6:05 pm
by tstoddard

That all makes perfect sense to me. Thank you for explaining it.

I'll be on vacation next week and plan to return with a couple of full memory cards that I can use to give FPV a good trial. I look forward to being able to move through my images quickly and do the culling I should be doing. I have never disciplined myself to get rid of the pictures that I will never use, partially because the tools I've used in the past never made it convenient enough to do. I started cataloging my photos last year after purchasing a new camera and starting to shoot to raw. I've learned that no one tool can do everything the way I'd like to be able to do it. FPV fills the last gap in my workflow that I haven't been able to fill satisfactorily before now. It's a great product and I look forward to seeing the next version.

Re: File Utilities - Import, rename, and copy

PostPosted: Sat Jun 29, 2013 11:26 am
by Axel
Starting from v1.9.300.0 a new {ImageIndex} variable is available. This index is unique within a batch processing session and can be used to solve the problem described above.

It starts at 1 and represents the rank of the current image in the whole image list being processed. Since it does not auto-increment at each use, it can be used to create multiple identically named copies with unique numbers as requested, in the same rule or in different rules part of the same rule set and applied together.

The variable can be inserted in a renaming template by right-clicking then clicking

"Insert Substitution Variable" -> "Counters" -> "ImageIndex".

A format option is available: for example {ImageIndex:4} will produce a zero-padded 4-digits numbers in the form NNNN e.g. 0001

Re: File Utilities - Import, rename, and copy

PostPosted: Mon Jul 08, 2013 10:57 pm
by tstoddard

Thanks for making this change. I will try it out later today.

By the way, I wouldn't have known about it if I hadn't scanned the forum just now. I don't see anyway to subscribe to topics so that I can be notified of any new posts. This change is something that's been discussed in other topics as well, if I remember correctly. It will probably be of interest to others who have not been following this topic. Is there anywhere that these changes are listed for each upgrade?

Thanks again!

Re: File Utilities - Import, rename, and copy

PostPosted: Tue Jul 09, 2013 10:02 am
by Axel
There is a change log on the download page, where I try to document every release with short description but admittedly this is less than ideal.