Problem with output from Photoshop:ClippingPathName

Started by ake, August 05, 2010, 03:29:21 PM

Previous topic - Next topic

ake

Hello,
I'm having problem with non ASCII charaters in clipping path names. A clipping path named 'Pfadé åäö 1' comes out like: 'Pfad? ??? 1'.
ake-g4:~ ake$ /usr/bin/exiftool -s -Photoshop:ClippingPathName /Users/ake/Desktop/test_image.jpg
ClippingPathName                : Pfad? ??? 1
ake-g4:~ ake$ /usr/bin/exiftool -s -Photoshop:ClippingPathName /Users/ake/Desktop/test_image.jpg|cat -vet
ClippingPathName                : PfadM-^N M-^LM-^JM-^Z 1$


I'm using Mac OS X 10.5.8 and exiftool version 8.27.

-Åke

Phil Harvey

Hi Åke,

Yes, this is a problem. :(

With your image the clipping path name seems to be encoded in Macintosh Roman.  I could easily decode this when extracting with exiftool if this was always the case.  However, reading the old version of the Photoshop file format specification I have, I can't find any mention of the character encoding used.  I suspect that the local system encoding is being used, and that the string would be different if you did this in Windows.  This sort of problem is unfortunately common across other types of metadata as well.

If I knew the encoding, I could decode it properly.  Read FAQ number 10 for a discussion of special character handling.

I would be more than happy to change this in exiftool if you could come up with some way of determining the encoding, or if by some stroke of luck the Windows version of Photoshop uses Macintosh Roman encoding too (unlikely, but I can't test this).

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

ake

Hi again,

After some more investigations it seems like the output has MacRoman encoding (http://en.wikipedia.org/wiki/MacRoman) but using "-charset MacRoman" doesn't make the output right. I changed the clipping path name to 'Pfad å ä ö 1 é' so that I got more characters to look for.
$ /usr/bin/exiftool -s -S  -Photoshop:ClippingPathName -charset MacRoman /Users/ake/Desktop/testbilder/test_2.psd
Pfad ? ? ? 1 ?
$ /usr/bin/exiftool -s -S  -Photoshop:ClippingPathName -charset MacRoman /Users/ake/Desktop/testbilder/test_2.psd |od -cx
0000000    P   f   a   d     214     212     232       1     216  \n   
           6650    6461    8c20    8a20    9a20    3120    8e20    000


Can you please advice me in how to make it work?

-Åke

Phil Harvey

Do you have access to Photoshop on a Windows machine?  If the Windows version uses Mac Roman (unlikely), or if we can find a way to determine the encoding, then I can decode it in ExifTool.  But I suspect that Photoshop probably just uses the local encoding without storing the encoding method in the file.

The -charset option won't help you unless I add a -charset photoshop=CHARSET feature, which is the only option if we can't determine the encoding otherwise.

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

ake

Created an image with a clipping path named 'Bana å ä ö é 1' in Photoshop CS5 on a PC with XP. It seems to store the clipping path in ISO 8859-1. Opening it in Mac Photoshop CS3 the clipping path is named 'Bana  ‰ ˆ È 1'. So it look like that Photoshop doesn't store the clipping path encoding.
I kindly ask you to add the feature -charset photoshop=CHARSET.

Regards, Åke

Phil Harvey

Hi Åke,

Thanks for running this test.

Could you possibly send me the sample from Windows so I can take a look (either attach it to a post here or email it to philharvey66 at gmail.com).  If I can't find the encoding stored anywhere I will add the -charset photoshop= option.

Thanks.

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

ake


Phil Harvey

#7
Thanks Åke,

I compared these files and couldn't find any obvious way to determine the encoding, so I will add the -charset photoshop= option to the next release.

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

Phil Harvey

Haha!  I just opened your Windows-generated PSD file in Photoshop CS4 for Mac, and the path name displays incorrectly!  This more-or-less proves that the character encoding isn't stored as it should be in these files.

So this should really be an Adobe Photoshop bug report, not an ExifTool bug report. :)

But the new option should allow you to work around this Adobe bug.

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

ake

Thanks for your efforts and solving the problem. I'm looking forward to the next release  :)

- Åke

Phil Harvey

#10
There you go.  8.28 has just been released. :)

I set the default charset to 'Latin', so the Windows file should work without any additional options, but the Mac file will require -charset photoshop=macroman (or mac or roman, which are both aliases for macroman).

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

ake

Thank you for your help, it works like a Swiss clock    ;D

-Åke