ExifTool Forum

ExifTool => Newbies => Topic started by: Exifusr on June 02, 2017, 06:44:03 PM

Title: Long base64 string as custom XMP tag value
Post by: Exifusr on June 02, 2017, 06:44:03 PM
Hi everyone! :)

I want to set a base64 string, that's representing an image, as a the value of a custom XMP tag.
For testing purposes I took the example config file [1] and executed exiftool -config example.config -NewXMPxxxTag1="$input" my.pdf

As result I get the error message bash: /usr/bin/exiftool: argument list too long

How do you load longer stings into the XMP tag variable?


[1] https://exiftool.org/config.html
Title: Re: Long base64 string as custom XMP tag value
Post by: StarGeek on June 02, 2017, 08:48:09 PM
You might be hitting the command line limit.  In Windows, for example, the command can't be longer then about 8,000 characters.  In bash it's a lot longer (see this Stackoverflow answer (https://stackoverflow.com/a/19355351/3525475)) but there is still a limit.

You might try writing the string to a temp file and then using -TAG<=DATFILE (http://www.exiftool.org/exiftool_pod.html#TAG-DATFILE-or--TAG-FMT)
Title: Re: Long base64 string as custom XMP tag value
Post by: Exifusr on June 03, 2017, 05:38:29 AM
Thank you very much StarGeek (^.^)b ! That was exaktly the option I was looking for :)

So to set very long strings as the value of a custom XMP tag you have to put the string into a file and pass the file as an quoted argument. That means exiftool -config example.config "-NewXMPxxxTag1<=/path/to/file_containing_string_value" my.pdf