How to always rename source file to _original?

Started by filigranen, January 12, 2021, 05:36:41 PM

Previous topic - Next topic

filigranen

Hello again.

Struggling with renaming of files this time.
I was under the impression that exiftool would rename the original file to _original unless -overwite_original was given, but it seems it only does so if the resulting filename is the same?

Can I force it to rename the original to _original somehow?

I get this:

$ ls
20200411_172852_IMG_0521.cr2*  MVI_0584.MP4*

$ exiftool -P -d "%Y%m%d_%H%M%S.%%le" '-allDates<CreateDate' '-FileModifyDate<CreateDate' '-FileName<CreateDate' .
    1 directories scanned
    2 image files created

$ ls
20200411_162853.cr2*  20200411_172852_IMG_0521.cr2*  20200430_151004.mp4*  MVI_0584.MP4*


when I expected this:

$ ls
20200411_172852_IMG_0521.cr2*  MVI_0584.MP4*

$ exiftool -P -d "%Y%m%d_%H%M%S.%%le" '-allDates<CreateDate' '-FileModifyDate<CreateDate' '-FileName<CreateDate' .
    1 directories scanned
    2 image files created

$ ls
20200411_162853.cr2*  20200411_172852_IMG_0521.cr2_original*  20200430_151004.mp4*  MVI_0584.MP4_original*


This is so that I do not end up with double the amount of images/videos with various dates. And, with lots of files in the dir, it's hard to tell which ones are the originals and which are renamed (my real command uses the "IMG_0521" and "MVI_0584" part of the filename using regex, so the only difference is the HMS part).

I add a custom XMP field to the altered files on my real command line, so I could just check if that tag is not set and if so rename the file in a second pass, but perhaps there is an easier/faster way?

StarGeek

Quote from: filigranen on January 12, 2021, 05:36:41 PMCan I force it to rename the original to _original somehow?

I do not believe so.  See Notes on the Writing "FileName" and "Directory" tags page.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

filigranen

Quote from: StarGeek on January 12, 2021, 06:40:50 PM
I do not believe so.  See Notes on the Writing "FileName" and "Directory" tags page.

Ah, too bad. Well, I think I can work something out where I do one pass first using -o or and then the same pass and overwrite the "originals".

Either way I have my backups, just in case.  :)
Thanks again!

Phil Harvey

...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 ($).