Obtain new output filename when moving/renaming

Started by buckley, February 12, 2014, 06:03:18 PM

Previous topic - Next topic

buckley

I have been trying to find a way to capture the new filename for each file that is being renamed due to
  exiftool -d %Y/%Y-%m-%d/%Y-%m-%d-%H%M%S%%-c.%%le ...
If there is no existing file which might have the same timestamp, then I can guess what the name might be. However, if there is a name collision, then the "-1,-2,etc" gets added, and I cannot guess what this will be without doing exhaustive checking in my script.
Is there a simple way to have exiftool tell me what the output name will be, or what the new name is if it has already been created?
I looked for a '-no-execute' or '-dry-run' type command that would have exiftool show output without writing a new file, but this does not seem to exist.
I also tried to find a way to easily capture a new name from the command output, but the default output is " 1 image files created", where I am hoping to get the actual file name (e.g., 2014/2014-02-12/2014-02-12-112346.jpg).

The reason I am doing this is:
iPhone names pictures as IMG_####.JPG
ImageCapture moves images into a pictures download (PICTMP) folder
I shift the pictures over to the 'dated' folder scheme (shown above)
But if I move the pictures out of PICTMP, then the next time I connect the iPhone, ImageCapture wants to again download ALL the pics on the phone, whereas I only want to download newer pics.
I want to create a symbolic link of the newly dated image back to the PICTMP folder with its original IMG_ name, thus saving space while fooling dumb ImageCapture app.

Thanks for any help.

Phil Harvey

A dry-run option would be extremely complex for me to implement, since earlier processed files may create files that affect the names of files processed later.

You can add a -v option to see where all the files went.  For each rename operation, you will see a line like this:

'tmp/a.jpg' --> '2014/2014-02-12/2014-02-12-112346.jpg'

I hope this helps.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

buckley

Okay, I thought that might have to be the way.
I'll figure out a way to collect the output from the command within my bash script and parse appropriately.
Thanks for the reply, Phil, and thanks for writing exiftool.