ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Erik Bachmann on January 24, 2018, 02:01:14 AM

Title: "Warning: No writable tags set" when copying field
Post by: Erik Bachmann on January 24, 2018, 02:01:14 AM
I'm trying to duplicate data from XMP:CountryCode to IPTC:Country-PrimaryLocationCode using:

exiftool -use MWG -@ cc.arg test.jpg

and the cc.arg
-CountryCode=DNK
-execute
-IPTC:Country-PrimaryLocationCode<CountryCode

exiftool responds:

Quote
No file specified
Warning: No writable tags set from test.jpg
    0 image files updated
    1 image files unchanged
Title: Re: "Warning: No writable tags set" when copying field
Post by: StarGeek on January 24, 2018, 04:04:25 AM
Short answer, use this:
exiftool -use MWG -@ cc.arg -common_args test.jpg

Longer answer, you're looking at the wrong error message.  No file specified appears first and is the cause of the following error.

First, the arg file commands are inserted into your command at the point it shows up.  So you command is the same as (adding the quotes around the tag copy for clarity)
exiftool -use MWG -CountryCode=DNK -execute "-IPTC:Country-PrimaryLocationCode<CountryCode" test.jpg

Then -execute splits the command into two separate runs, which would be the same as running these two commands (except exiftool doesn't actually exit)
exiftool -use MWG -CountryCode=DNK
exiftool "-IPTC:Country-PrimaryLocationCode<CountryCode" test.jpg


If you notice, your first "command" doesn't have a file name.  That's where the No file specified error appears.  Then, the second command tries to copy CountryCode, but you haven't set that tag, so that's where you get the Warning: No writable tags set from test.jpg error from.

What you want is for your file, test.jpg, to be part of all parts of the command.  That's where you add -common_args .  Anything after that option is applied to all parts of the command when they're separated by an -execute
Title: Re: "Warning: No writable tags set" when copying field
Post by: Erik Bachmann on January 24, 2018, 06:30:56 AM
That makes sense!
So what I actually wanted to do was:
%exiftool% -v -@ cc.arg -@ sync.arg -common_args test.jpg
Where cc.arg holds the "update" - and sync.arg the synchronisation. This means the sync.arg is build once and reusable.
Title: Re: "Warning: No writable tags set" when copying field
Post by: Phil Harvey on January 24, 2018, 07:02:26 AM
<-- impressed with StarGeek's detailed explanation