Inconsistency writing to shortcut with -E

Started by StarGeek, August 31, 2018, 06:48:36 PM

Previous topic - Next topic

StarGeek

Category: Bugs nobody else but crazy StarGeek would find

In my config file, I have the following shortcut definition:
MyDesc => ['Description','Caption-Abstract'],
It allows me to read and write to both Description and Caption-Abstract at the same time.

I also have a short Autoit3 script that replaces characters that are hard to deal on the command line in Windows, such as double quotes ", new lines, etc with their HTML entities.  I then use the -E option to write the data.  Me, being the lazy sort, grabbed a Autoit 3 UDF (User Defined Functions) to deal with the conversion.  I noticed right away that there was a problem with it.  When encoding something, it would double encode the ampersand.  So a double quote " would turn into ".  Obviously incorrect.  But when I used a command like this:
exiftool -E -MyDesc=""Some text"" FILE
It worked out fine, saving "Some text" to the file, so I didn't worry about it.

Today, I figured out that it only works in the case of the short cut.  Directly writing to the individual tags would end up with "Some text".

Example:
C:\>exiftool -P -overwrite_original -E -Mydesc=""Some text"" y:\!temp\Test3.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -Description y:\!temp\Test3.jpg
---- XMP-dc ----
Description                     : "Some text"

C:\>exiftool -P -overwrite_original -E -Description=""Some text"" y:\!temp\Test3.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -Description y:\!temp\Test3.jpg
---- XMP-dc ----
Description                     : "Some text"

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

I love it when you find subtle bugs. :)

It may be a couple of days before I can read this in detail (long weekend 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 ($).

StarGeek

It's all good.  I already fixed my autoit script and it's not likely to affect anyone else.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

StarGeek

Just a bump to see if you found time to look for this bug.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

#4
Thanks for the reminder!  -- I had lost track of this one.

And thanks for the bug report!

This will be fixed in 11.16

- Phil

Edit: ExifTool 11.16 is now available
...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 ($).