Picasa ExifTool filename2caption subtle change assistance request

Started by hamesdor, December 11, 2015, 08:52:26 AM

Previous topic - Next topic

hamesdor

More progress - more problems:
Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1554.tif"
Warning: Malformed UTF-8 character(s) - H:/ASI/Travel & Photos/Israel/Israel - P
hotographs/2013/083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_1554.tif
    1 image files updated
Press any key to continue . . .

The end result is that no caption is saved in the image....
So this time it has something to do with the fact that I use Hebrew characters.
How can I solve this one?
(and here there's no way getting around it - Hebrew is my native language, so a large of volume of my images are stored in folders  where the pass contains Hebrew characters).
Thanks in advance!

Phil Harvey

Did you try specifying -charset filename=utf8 in the exiftool options used by the script?

- 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 ($).

hamesdor

For testing:
"%BatFileDir%\exiftool.exe" -charset filename=utf8 -overwrite_original "-xmp:description<${directory;s(.*/)()}" "-iptc:caption-abstract<${directory;s(.*/)()}" %*

I get the error:
Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1554.tif"
Unknown type for -charset option: filename
Warning: Malformed UTF-8 character(s) - H:/ASI/Travel & Photos/Israel/Israel - P
hotographs/2013/083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_1554.tif
    1 image files updated

What did I do wrong?
(I apologize for my ignorance in programming)
- also please notice that only the folders contain Heb. Chars.

Thx

Phil Harvey

You must be using an old version of ExifTool.  The -charset filename option was added in version 9.79.  Try updating to the most recent version.  Actually, that alone may solve this problem.

- 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 ($).

hamesdor

I've downloaded the latest exec from your website.
Now I get:

Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1554.tif"
Invalid filename encoding for H:/ASI/Travel & Photos/Israel/Israel - Photographs
/2013/083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_1554.tif
Error opening directory H:/ASI/Travel & Photos/Israel/Israel - Photographs/2013/
083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_1554.tif

I've tried purging Picasa & IE cache files (Picasa uses IE interface) exit and re-open it. didn't do the trick.

Perhaps it's worth noting that the CMD window itself shows all the heb. chars. as gibberish (as opposed to the browser which displays the original folder path correctly when viewing this specific post).

Any ideas?

Phil Harvey

OK, so that didn't work.  (Are you getting the impression that special characters in Windows filenames are a pain?)

So the file names are not specified in UTF8.  What character set is your system using?  If Latin2 for example, then try adding -charset exiftool=latin2 to the command so that ExifTool will translate from this to the appropriate character set.

- 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 ($).

hamesdor

So, it turns out that my CMD shell wasn't configured for Hebrew characters correctly.
So I fixed that according to: http://ariely.info/Blog/tabid/83/EntryId/139/Windows-console-command-shell-Using-Local-Languages-En-US.aspx

But now I get the error:

Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1554.tif"
Warning: Error opening file - H:/ASI/Travel & Photos/Israel/Israel - Photographs
/2013/083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_1554.tif
Error: File not found - H:/ASI/Travel & Photos/Israel/Israel - Photographs/2013/
083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_1554.tif
    0 image files updated
    1 files weren't updated due to errors

Notice that the gibberish chars. in the error have changed to Cyrillic char set (I think), whereas the original path is correctly displayed in hebrew (I cannot exemplify this since it's auto corrected by chrome when I copy paste it to here).

My setup is according to your FAQ supported char sets - Hebrew (cp1255)
Just in case, I also tried CP862 (OEM), but it didn't work, so I guess it's not supported...

So, now what do I do?
chr*st, I think I'm going to cry... :'(

Phil Harvey

What exiftool options did you use in your last try.  I suggest: -charset exiftool=cp1255

- 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 ($).

hamesdor

I've tried:
"%BatFileDir%\exiftool.exe" -charset exiftool=cp1255 -charset filename=cp1255 -overwrite_original "-xmp:description<${directory;s(.*/)()}" "-iptc:caption-abstract<${directory;s(.*/)()}" %*

and am getting warning error:

Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1554.tif"
Warning: Some character(s) could not be encoded in Latin - H:/ASI/Travel & Photo
s/Israel/Israel - Photographs/2013/083113/δ≡± ßεδσ∩ ⌠σ∞Θ± - ε≈σ°σ· Σα∞⌠αßΘ·/IMG_
1554.tif
    1 image files updated

Final result: caption remains blank
am I missing an additional handle?
(as it still warns about 'Some... Latin' but not specific enough so I'll know what to add)

Hayo Baan

Still looks like your filenames are not in the same encoding as what exiftool thinks it is/what you tell it.
What code page is your terminal set to? Run the command chcp and tell us the outcome.
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Quote from: asiniv on December 15, 2015, 12:42:10 AM
I've tried:
"%BatFileDir%\exiftool.exe" -charset exiftool=cp1255 -charset filename=cp1255 -overwrite_original "-xmp:description<${directory;s(.*/)()}" "-iptc:caption-abstract<${directory;s(.*/)()}" %*

and am getting warning error:

Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1554.tif"
Warning: Some character(s) could not be encoded in Latin

Now we're making some progress.  Assuming that the XMP:Description got written properly, then the remaining problem is the IPTC encoding.   See FAQ 10 for all of the details, but this is the command I would suggest:

"%BatFileDir%\exiftool.exe" -charset exiftool=cp1255 -charset filename=cp1255 -charset iptc=utf8 -codedcharacterset=utf8 -overwrite_original "-xmp:description<${directory;s(.*/)()}" "-iptc:caption-abstract<${directory;s(.*/)()}" %*

Yes, this character encoding business is tricky.  Especially on the Windows command line and particularly with IPTC.

- 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 ($).

hamesdor

Hmmm... this is weird:

Active code page: 1255
Busy processing file "H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\08
3113\כנס במכון פוליס - מקורות האלפאבית\IMG_1555.tif"
    1 image files updated

C:\Tools\PicasaScripts\
Press any key to continue . . .

Your command runs smoothly (I've added chcp 1255 beforehand to the batch file), and the caption is written in the IPTC info (verified externally with IrfanView).

HOWEVER, Picasa does not display it, which is even stranger as the original write2caption of the filename to the direction works in order and is recognized correctly by Picasa.
I've tried exit-reenter / clear cache / remove folder completely and re-scan it - nothing helped :-(
So now I'm confused:
Either there is still something erroneous related to the Heb. chars. encoding; Or maybe Picasa stores/writes the caption information in a different manner -
I've tried comparing my test file IPTC to another file without heb. chars. which was edited by Picasa - I could not spot any differences.
Or perhaps this is now strictly a Picasa issue?

What am I missing here? any suggestions?

Thx

Phil Harvey

You should be able to iterate a few times with Picasa to find the problem.  First try this command on a file with a simple ASCII name and see if Picasa displays the caption.  If not, then compare the output of "exiftool -a -G1" for this file and the same file with the same caption written by Picasa.  This should show you the difference that is causing problems for Picasa.

- 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 ($).

hamesdor

made a few more iterations -
H:\BACKUPS\Picasa Additions\Israel\test3\test.jpg  VS H:\ASI\Travel & Photos\Israel\Israel - Photographs\2013\083113\כנס במכון פוליס - מקורות האלפאבית\IMG_1555.tif

The one from the left(test.jpg - short English-only folder path), works fine and the caption is written and recognized properly by Picasa
The right one (IMG_1555.tif heb. chars. long path) command line operation is completed successfully like the above (irfanview recognizes caption), but nothing is recognized by Picasa.

aside of the TiFF / JPG, I could not spot any meaningful difference, so I tried it on another tif image I copied to the simple folder.
The same problem occurred - command is performed successfuly, caption is written and recognized by irfanview, but nothing in Picasa...

Hmmm....errrr... bug in Picasa?
I'm just about to call it quits and go back to manual labor  :'(
(For reference, attached are the ExifTool -a -G1 output for both files)

Phil Harvey

Too many things changed between these files to say what caused the problem.

What happens if you write a caption to the problem file with Picasa, then look at the differences in the exiftool output before and after.  You should be able to narrow this down to a single change that causes the Picasa problem.

- 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 ($).