Can you write a capsule or sidecar "someplace else" ?

Started by silversleevesx, March 13, 2014, 06:45:51 PM

Previous topic - Next topic

silversleevesx

Exiv2 has the -l option for writing .exv or XML sidecar files to a directory other than the one containing the source file. Though I've not spent much time looking, so far I haven't found anything similar in Exiftool. It would be convenient to point "exported" metadata to another specific location, so long as the user has write access to that other folder (on the same volume, in a single-user environment for example, this is a given.). "Convenient" here meaning it would save one time moving it oneself, via mv or 'move' command, or in the GUI of their file navigator.

If such an option or mechanism doesn't exist, I hope it will be considered for implementation in a future version of Exiftool.

BZT

Phil Harvey

You can perform operations on sidecar files in any directory by specifying the sidecar directory name in the command.  ExifTool has incredible flexibility in this regard.  You can specify a static directory name, extract any portion or all of the source file directory name, or a combination of the two.  Read the application documentation for all of the 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 ($).

silversleevesx

Phil,

Before I upgraded to 9.5.4, I went backwards and forwards in the docs for 8.77, including the HTML "pod" page (reproduction of the man page, it looked like), and I couldn't find a reference to writing MIE's or XMPs anywhere but the directory in which the source file exists. I guess I'm either lazy or too inclined to call Andreas' "-l" option something besides genius, or I'm not getting the man page phrasing right. Could you point out an area of the documentation in which I could start looking?

Sorry if any of the above sounds like Churchill's famous "That is something with which I will not put."  :) I get into couching and covering from time to time, and being myself so detail-oriented, I kind of wish I never learned the "don't end a phrase with a preposition" rule.

Cheers.

BZT

Phil Harvey

It depends on how you create the sidecar.  Here is one example:

exiftool -o "some/other/directory/%f.xmp" DIR

Also see Example number 17 here.

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

silversleevesx

Phil,

I'm starting to get it, I think. Attached is the BASH script I have been using to create MIE files from stdin, written around the -TagsFromFile operation.  A "where do you want %f.%capsule" query (where a dot would mean the current working directory) and a command inside a conditional statement (if/then/fi) specifying the path as well as the name of the MIE (or EXV or what have you) file, would allow for both. Right now, I write MIE data back borrowing from my script for writing back all EXVs for which there are similarly-named image files (a for/do/done loop)  in one's present directory.

I have a few ideas of how to write those back from other places as well. None of this is as simple as Exiv2's -l command, but on the other hand, Exiv2 can read and write only image file metadata. It's easier to run the bases when the field is smaller, so to speak.  :)

Cheers.

BZT