ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Jom on October 16, 2019, 04:23:47 PM

Title: "-restore_original" without modified files.
Post by: Jom on October 16, 2019, 04:23:47 PM
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?

(https://exiftool.org/forum/index.php?action=dlattach;topic=10523.0;attach=3307)
Title: Re: "-restore_original" without modified files.
Post by: StarGeek on October 16, 2019, 05:13:35 PM
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
Title: Re: "-restore_original" without modified files.
Post by: Jom on October 16, 2019, 05:36:01 PM
Thanks, Bryan!
Title: Re: "-restore_original" without modified files.
Post by: Jom on October 16, 2019, 06:48:45 PM
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
Title: Re: "-restore_original" without modified files.
Post by: Phil Harvey on October 17, 2019, 07:12:16 AM
You can use "del *_original" to delete the _original files if you have renamed the edited files.

- Phil
Title: Re: "-restore_original" without modified files.
Post by: Jom on October 17, 2019, 12:10:12 PM
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?
Title: Re: "-restore_original" without modified files.
Post by: 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).

- PHil
Title: Re: "-restore_original" without modified files.
Post by: Jom on October 17, 2019, 01:03:45 PM
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?
Title: Re: "-restore_original" without modified files.
Post by: Phil Harvey on October 17, 2019, 01:05:21 PM
Oh.

Then: "yes".

I misunderstood what you were saying.

- Phil
Title: Re: "-restore_original" without modified files.
Post by: Jom on October 17, 2019, 01:10:23 PM
Thanks, now I feel much better.