Writing both user-defined tags and existing tags to output

Started by remarkableearth, November 20, 2017, 07:29:58 PM

Previous topic - Next topic

remarkableearth

I'm having trouble writing a set of tags to output when the set is a mix of user-defined tags and tags written at the time of capture. 

I can write them fine independently. For the user-defined tag, exiftool -image-location_city=Seattle IMG_1528.JPG and for the existing tag, exifftool -createdate IMG_1528.JPG but when I mix, exiftool -csv -createdate -image_location_city=Seattle IMG_1528.JPG > testmix.csv, I get this: Ignored superfluous tag name or invalid option: -createdate
    1 image files updated

and the csv file is empty. An on-screen check on the Image Location City tag shows that it is updated with Seattle.

I assume it is possible to mix them in a command so what am I doing wrong?

Phil Harvey

You are trying to read from the file and write at the same time.  These must be done in separate commands.

Either that or you are confused about what you want to do.

Reading the overview section here may help clear things up.

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

remarkableearth

Phil,

Thanks so much. You are right - I was trying to read and write simultaneously, so thanks for setting me straight and for the overview section.

Matt

remarkableearth

Now that I've correctly written my custom tags and need to read them as well as some pre-defined tags to output to csv, I'm not getting the result I'd like.

As you recommended previously, I wrote custom tags with the config file (aaa substituted here as namespace for confidentiality):
'Image::ExifTool::XMP::Main' => {
        aaa=> { # <-- must be the same as the NAMESPACE prefix
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::aaa',
            },
        },
    },

%Image::ExifTool::UserDefined::NCEI = (
    GROUPS        => { 0 => 'XMP', 1 => 'XMP-aaa', 2 => 'Image' },
    NAMESPACE     => { 'aaa' => 'http://ns.myname.com/aaa/1.0/' },
    WRITABLE      => 'string', # (default to string-type tags)
    tag1  => { },
    tag2  => { },
    tag3  => { },
);


tag1 tag2 tag3 will be populated manually once the metadata are outputted to csv since they are each custom data inputs. So they need to be output as blanks to my csv. That's problem 1.

Problem 2 is I wish to combine them with existing metadata in my output csv. I define those tagx=xxx tagy=yyy tagz=zzz.

So far, I've been able to get all six fields to output only if I first populate with dashes those I wish to remain blank: -tag1=- -tag2=- -tag3=-, then run exiftool -csv -tag1 -tagx -tag2 -tagy -tag3 -tagz /dir/subdir -ext jpg > output.csv

If I remove the dashes (-tag1= -tag2= -tag3= ) and call exiftool -csv -tag1 -tagx -tag2 -tagy -tag3 -tagz /dir/subdir -ext jpg > output.csv the output removes altogether the fields with the dashes removed.

Surely there must be a way to combine custom tags left blank with predefined tags populated with existing metadata into one output file.

Phil Harvey

Add the -f option to force missing tags to be output as "-".

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