LayerNames Character Limitation

Started by JUZZA, February 18, 2017, 11:48:18 AM

Previous topic - Next topic

JUZZA

Is there a character limit in the tool when getting layer names once the -LayerNames option because it appears to me it is only capturing a maximum of 31 characters.  I wondered if this was a Photoshop limitation but with version 14.2 and above it now supports up to 255 characters.

I discovered this by chance as I am using the tool to generate the relevant content I require for all Photoshop files within a folder.  I then read that text file in PHP and export the data into MySQL.  When I was checking the data in the database I could see some of it was missing.  I did some testing by creating some dummy layers with really long names and once exported it was only capturing a maximum of 31 characters.

System type: Windows 10
ExifTool version: 10.4.3.0
Command Line: exiftool.exe -filename -Description -TextLayerText -IngredientsFilePath -LayerNames -gpslatitude -gpslongitude -n -php "<FOLDERNAME>" > "<FOLDERNAME>\exifdata.txt"

Phil Harvey

I haven't imposed a limit.  If you find a file that you believe contains more characters than ExifTool reports, please send it to me and I'll take a look (philharvey66 at gmail.com)

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

JUZZA

Hi Phil

I create my own Photoshop files from scratch based around my hobby of hunting out filming locations.  Rather than embed my photos into the PSD file I've been using Smart Objects which link to original files and this works really well.  The layers are automatically named based on the link file into the Smart Object.

For example, take the movie Highlander. The files I link to would be called things like highlander_castle_main.jpg, highlander_castle_left.jpg and highlander_castle_right.jpg.  The layer name automatically becomes those names without the extension.

This was fine in my testing until I created a file for a movie with a long name.  For example, Indiana Jones and the Last Crusade.  Now the Smart Object link names are indiana_jones_and_the_last_crusade_main.jpg and so on.

As you can see with Highlander the longest amount of characters was 23 but for Indiana Jones it is 39.  Problem is anything after 31 characters is not being written to the text file by ExifTool.  All I would get was indiana_jones_and_the_last_crus which as you can see is a problem.

Normally I suspect most people wouldn't use such long names for layers (if they name them at all  :P) from the defaults.  However for my purposes they have to be named.

As a test I created a blank Photoshop file and created one layer with a really long name.  When I ran it with your tool it still only captured 31 characters.

I named the layer: The real voyage of discovery consists not in seeking new lands but seeing with new eyes

Ran this command: "B:\exiftool.exe" -filename -Description -TextLayerText -LayerNames -IngredientsFilePath -gpslatitude -gpslongitude -n -php "B:\long" > "B:\long\metadata.txt"

This is the result.

"LayerNames" => "The real voyage of discovery co"

You should be able to replicate the problem yourself but more than happy to send you the test Photoshop file I created if you want.

In the meantime I am getting around the problem by reading the  IngredientsFilePath and extracting the necessary information I need.  In fact I will probably continue to use this method but I still felt you would like to know about any problems so they can be fixed if it turns out to be something in the ExifTool.

Phil Harvey

I just tested this myself.  Try using LayerUnicodeNames instead of LayerNames.  (And be sure you are using ExifTool 10.38 or later.)

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

JUZZA

Hi Phil

I just tested it and it works with the -LayerUnicodeNames which in all honesty I didn't even know was an option and that is a failing on my part.  Normally I just run it to extract everything and then browse through looking for what I want then then use those options.

As I said I got around the problem when I first discovered it by extracting the data from the -IngredientsFilePath results which ended up being a better option for me.  However, great to know it will work with the -LayerUnicodeNames..

Many thanks for your help and I hope in some way, even if just a little bit, the feedback was helpful.

Phil Harvey

The LayerNames 32-character limit is new to me, but LayerNames doesn't handle special characters very well either, so LayerUnicodeNames is a better choice for a couple of reasons.

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