ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: StarGeek on August 31, 2018, 06:48:36 PM

Title: Inconsistency writing to shortcut with -E
Post by: StarGeek on August 31, 2018, 06:48:36 PM
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 (https://exiftool.org/exiftool_pod.html#E--ex--escapeHTML--escapeXML) 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"

Title: Re: Inconsistency writing to shortcut with -E
Post by: Phil Harvey on August 31, 2018, 09:34:40 PM
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
Title: Re: Inconsistency writing to shortcut with -E
Post by: StarGeek on September 01, 2018, 02:34:37 AM
It's all good.  I already fixed my autoit script and it's not likely to affect anyone else.
Title: Re: Inconsistency writing to shortcut with -E
Post by: StarGeek on October 25, 2018, 05:00:16 PM
Just a bump to see if you found time to look for this bug.
Title: Re: Inconsistency writing to shortcut with -E
Post by: Phil Harvey on October 26, 2018, 07:40:11 AM
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