"-restore_original" without modified files.

Started by Jom, October 16, 2019, 04:23:47 PM

Previous topic - Next topic

Jom

Win 10
ExifTool 11.70


I renamed the derived png-files and now cannot restore png_original-files with -restore_original command.
If this is has done on purpose, then what is the reason for this? Or it  feature is undocumented?


StarGeek

Exiftool needs a filename to restore the original to.  It can't operate directly from the *_original files.

You can run this command to remove the _original part of the filename which will restore the original files.
exiftool "-filename<${filename;s/_original$//}" /path/to/files/*_original
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Jom


Jom

I renamed the updated files *.png and could not delete the files *.png_original with command -delete_original.
Maybe it makes sense to add an option (or new commands) for commands -restore_original and -delete_original to execute these commands without updated files?
For example:
exiftool -restore_original -orphans
exiftool -delete_original -orphans
or
exiftool -restore_original_orphans
exiftool -delete_original_orphans

Phil Harvey

You can use "del *_original" to delete the _original files if you have renamed the edited files.

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

Jom

Yeah, in these cases (restore or delete *_original-files) ExifTool architecture does not assume the use of special commands, and assumes the transition to the normal mode of working with files using the command line or file manager?

Phil Harvey

No.  ExifTool will only restore/delete the original if the edited image exists with the same name (minus the "_original" suffix).

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

Jom

Quote from: Phil Harvey on October 17, 2019, 12:13:00 PM
No.  ExifTool will only restore/delete the original if the edited image exists with the same name (minus the "_original" suffix).

No? (I meant what you just wrote. Maybe "Yes"?)
I. e. if edited image is not exists with the same name (minus the "_original" suffix), I have to do everything myself (restore or delete *_original-files) using the command line or file manager?

Phil Harvey

Oh.

Then: "yes".

I misunderstood what you were saying.

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

Jom