Write location erroneous with single image from image sequence (FILE.1234.EXT)

Started by VinceLemon, June 09, 2021, 09:16:44 PM

Previous topic - Next topic

VinceLemon

Oh hi,

I'll start with my end goal as this may clear a few things up: Export JSON in TARGET DIRECTORY (not SOURCE DIRECTORY) from a single pre-selected file from an image sequence formatted as such: THIS_IS_AN_IMAGE_SEQUENCE.####.EXT (whereas #### is the frame padding, obviously).

Right now, when I am trying to achieve this, with the following command:
exiftool IMAGE_SEQUENCE.1009.exr -json -w test/json

This is the output of the console:

Error creating IMAGE_SEQUENCE.1009.test/json
    1 files could not be read
    0 output files created


We can see that obviously this won't work since it tries writing in
QuoteIMAGE_SEQUENCE.1009.test/json
and for some reasons it will only strip the extension?

Any help on this would be greatly appreciated. Yet another NOOB question, I know, I know...

Phil Harvey

You can use %d, %f and %e in the -w option argument to represent the source file directory, name and extension.  Read the -w option documentation for details.

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

VinceLemon

Ah, gotcha! It works now. Thank you.

But it's quite strange that it won't work if no format specifiers are used.

This works:
exiftool AN_IMAGE_SEQUENCE.1009.exr -json -w /home/USER/Desktop/test_metadata/%f_%e.out

While this doesn't:
exiftool AN_IMAGE_SEQUENCE.1009.exr -json -w /home/USER/Desktop/test_metadata/output_file.out

I did read on the documentation beforehand but it appears I did not read about such behaviours being expected?

Phil Harvey

-w[+|!] EXT or FMT (-textOut)
            Write console output to files with names ending in EXT, one for
            each source file.  The output file name is obtained by replacing
            the source file extension (including the '.') with the specified
            extension
(and a '.' is added to the start of EXT if it doesn't
            already contain one).  Alternatively, a FMT string may be used to
            give more control over the output file name ...


If you don't want to use any of the format specifiers, just put %0f in the argument so it will be interpreted as a FMT string. (This is also mentioned in the docs.)

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

VinceLemon

Fantastic!

Sorry for having missed this text in the documentation and... thank you so much Phil!

Have a nice evening.