Title info of Jpgs are very stubborn it seems

Started by I3ordo, April 05, 2022, 04:28:05 AM

Previous topic - Next topic

I3ordo

Currently, we are having problems writing numeric characters, non-English character  and symbol writing issues "&" "_" when writing to title, authors, tags (top editable entry of a jpg details).

I tested and was able to write numeric numbers and "&" "_" numbers (manually\ by right click\file details), but we are getting 'charmap' codec can't encode characters in position 13-17: character maps to <undefined> errors so i would like to test it my self via command line.

I already learned that i can write tags to jpg files via exiftool.exe -sep ";" -subject+="keyword1";"key word 2" dest.jpg but that was for the tags...
If i wanted to write to Title, which argument should i use instead of "-subject" ? and i want to test it using "-m" and see for my self what kind of issues the jpgs will have with picasa...

Also if titles cant accept numeric numbers and symbols (&)  i reckon a "-m" argument mentioned which ignores some 64 character limitations, does that  option also include ignoring non-allowed  characters written to "not meant" fields?

It would be great if i was directed to a page where i can conveniently check which command (much like using "-subject" for writing to tags field) to use for writing to a JPG's Title, copyright, author , camera maker, camera model".

Thanks for your patience gentlemen.




StarGeek

Quote from: I3ordo on April 05, 2022, 04:28:05 AM
Currently, we are having problems writing numeric characters, non-English character  and symbol writing issues "&" "_" when writing to title, authors, tags (top editable entry of a jpg details).

Skipping the problem with accented/UTF8 characters at the moment, remember yesturday when I said
Quote from: StarGeek on April 04, 2022, 02:55:08 PM
Don't break up the options with quotes.  Put them around the whole thing when needed otherwise you may get unexpected results.
exiftool -sep ";" -subject+="Keyword 1;Keyword 2"

Well guess what, unexpected results.

I'm not sure why you would have problems with underscores and numbers without seeing your exact command and exact output, but the problem with the ampersand is that it is a special character on the Windows command line.  In this case, the ampersand means run the command before the ampersand and then run the command after the ampersand, while two ampersands means run the second command only if the first command returns success.

The easiest way to avoid this is to encase the whole string in quotes.  The second way would be to put a caret ^ before it.

Example for ampersand, numbers, and underscore
C:\>exiftool -P -overwrite_original -Title="This & That, Numbers 12345, Underscore _" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -Title y:\!temp\Test4.jpg
[XMP-dc]        Title                           : This & That, Numbers 12345, Underscore _


Quotebut we are getting 'charmap' codec can't encode characters in position 13-17: character maps to <undefined> errors so i would like to test it my self via command line.

I'm pretty sure that this is not an exiftool error, as that text does not appear in the source code.  It helps if you copy/paste full command and output so we can see everything that's going on, like the [code][/code] section I post above.

QuoteIf i wanted to write to Title, which argument should i use instead of "-subject" ? and i want to test it using "-m" and see for my self what kind of issues the jpgs will have with picasa...

I no longer have Picasa installed so I can't check there, but my notes don't indicate that Picasa reads Title data, only "Caption", for which it reads from XMP:Description and IPTC:Caption-Abstract.

There are multiple tags that Windows will read for "Title" (this post shows what Windows reads) and unfortunately it ignores the standards.  It will read EXIF:XPTitle, EXIF:ImageDescription, IPTC:Caption-Abstract, XMP:Description, and XMP:Title.  The first one, as with all EXIF:XP* tags, is basically Windows only.  The next three are equivalent tags that are intended for a long description, while the one actually named Title, is intended for a short verbal and human readable name for the image, this may be the file name.  The IPTC equivalent to XMP:Title is IPTC:ObjectName.  Also take note that Lightroom uses these two tags as a short description of the file, for which the correct tag for a short description would be IPTC:Headline/XMP:Headline.

QuoteIt would be great if i was directed to a page where i can conveniently check which command (much like using "-subject" for writing to tags field) to use for writing to a JPG's Title, copyright, author , camera maker, camera model".

The trouble is, you're assuming that metadata is nice, neat, and tidy.  It is not.  It's a complete hot mess of competing standards.  Many programs give the same tag a different name when they read the data, as shown by the above Windows example.  The best procedure is to write some data with the program you're using and then use the command in FAQ #3 to see what locations that program wrote too.

Now, with regards to accented and other non-ASCII characters.  This is FAQ #18 and a bit of FAQ #10.  Windows command line does not really deal well with non-ASCII characters.  You should first try the options in FAQ #18 to change the code page and see if that works for you.  It never did for me, unfortunately.  You can also try specifying a character set as in note #1 in FAQ 10.  Using the -L (latin) option as mentioned there worked for me a lot of the time, especially when using exiftool to output data.

Another, more extreme option, is this StackOverflow answer, which forces Windows to use UTF8.  This works well for me, for the most part.  It does alter the fonts in some older GUIs.  This post gives an example of the changes.

The final option is to encode the more problematic characters as html entities and use the -E (-escapeHTML) option.  For example, to encode é, you could use &eacute;
C:\>exiftool -P -overwrite_original -E -Description="Beyonc&eacute;" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -Description y:\!temp\Test4.jpg
[XMP-dc]        Description                     : Beyoncé
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype