Feature request: read-only mode for testing

Started by orax, June 20, 2014, 07:51:23 PM

Previous topic - Next topic

orax

Hello ! I thought a sort of read-only mode for testing, like the new "TestName" tag, might be useful.

For example:

exiftool -NEW_OPTION '-Caption-Abstract<${TAG;s/my_complex_regex/.../}' '-Author=Me' 'IMG.jpg'
'IMG.jpg'
    Caption-Abstract --> 'The new Caption-Abstract'
    Author --> 'Me'
    0 image files updated
    1 image files unchanged

Phil Harvey

How about this?:

exiftool '-Caption-Abstract<${TAG;s/my_complex_regex/.../}' '-Author=Me' -v3 -execute -restore_original -common_args 'IMG.jpg'

True, this is not as nice, but as long as the _original file doesn't exist to begin with, it would do the same thing.

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

orax

This solution didn't come to my mind.
With -v0 to -v2 instead of -v3, I have what I wanted.
Thanks !

ecl10

Hi. I was hoping for a similar feature but for a different reason. As a newbie, I'm not always entirely sure whether the flags on a particular exiftool invocation will result in files being transformed or not.  Sometimes I want to be certain that the invocation does *not* modify any files. A read-only flag would ensure that I don't shoot myself in the foot. Whenever I use it, I know I'm safe. Sure, the _original files help. But I need to check to see if any _original files where generated to confirm that exiftool didn't, in fact, change anything. This is a particular pain when operating recursively over directories.

There are two ways to do this.  The "easy" way: You could have a --read-only flag. Any flag that would change any files (e.g., -TAG=newval) is incompatible with --read-only (i.e., would result in exiftool to fail). This does not satisfy orax's use case, but it does the trick for my scaredy-cat use case.

The "hard" way: You could have a --dry-run flag that does all the work dictated by the other flags w/o actually transforming any files.  This is likely harder to implement. This satisfies orax's use case (this is exactly what he was asking for; although Phil's suggestion for automatically restoring the original file after transformation works, I don't have enough confidence in getting all the flags right all the time, so I'd never use it). And it would also work for my use case (i.e., the presence of  --dry-run ensures that no files will be updated).

Just a thought.

Thanks for exiftool!

E

steve02476

As a Newbie, I don't really comprehend the original question in this thread, or Phil's reply...

But the title of this thread makes perfect sense to me, along with ecl10's remark.

I agree, it's a little mysterious to a beginner which commands are getting data and which commands are changing data. For my project, I purely want to read data, I don't want to change anything. Without being an expert in every command line option that I want to experiment with, how can I feel safe testing against live data?

I'm sure I could do something crude like make a copy of every file, then run my commands on the copy, then check for changes - but I work with large files (not infrequently 150MB) and it sure would slow things down to have to copy every file before I do something with it, just to have confidence that I'm not wrecking the original... 

I love the idea of a --readonly command that would tell exiftool to ignore and complain about any command that actually would change the original data.

Hope I'm making sense. -steve

StarGeek

As long as there isn't an equal, less than, or greater than sign (=<>) in you command, you aren't changing any data. 
* 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).

steve02476

That's great!

Actually, I have a > at the end of my exifTool command, to write the output to a separate file, but that's fine. Thanks. -Steve

StarGeek

* 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).

ecl10

Quote from: StarGeek on July 15, 2016, 04:17:24 PM
As long as there isn't an equal, less than, or greater than sign (=<>) in you command, you aren't changing any data.

What about -geotag? Doesn't that change the files to which it is applied?  Thanks.

StarGeek

* 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).

Phil Harvey

Even if you accidentally edit metadata in a file (which is hard to do), the original files will be automatically saved with a "_original" extension, so you don't need to worry (unless you also add the -overwrite_original option).

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