• Bugs
  • Bug in Photoshop export script: "LayersToPNG.jsx"

Related Discussions
...

Hi!

First of all thanks for this amazing piece of software!

There's a small bug in the photoshop script: "LayersToPNG.jsx":

If the PSD file contains an empty layer ( a layer than contains only transparent pixels ), the script will silently stall.

To reproduce:

1.) Create a photoshop file with a an empty layer ( or select all pixels on a layer and delete them).
2.) Run script => script stops somewhere in the middle.

To make the script run successfully again on the same file:
Add some visible pixels to the empty layer.

Should be an easy fix 🙂

Thanks!

Thanks for the info!
Yeah, Photoshop scripts can just stop without an error message if it encounters something unexpected.
I remember it used to stop unexpectedly when you had some arrangement of folders but that was fixed a while back.

Seems the script doesn't work if there is anything but the images to be exported in the PSD. i.e, it doesn't work if I have a hidden folder or a hidden layer (empty or not). A bit finicky, would be good if this was mentioned in the tutorials / documentation.

21일 후

I can't make it to work properly. I have the same problem as GMTDev. If I have invisble folders, it hangs and doesnt export anything. This is very inconvenient since I have to duplicate to a new file and delete everything I don't need to export.

I have PNG Express and it exports a json file, but unfortunately the json it is incompatible with Spine as it won't load up anything.

Is there another solution to export pngs and json into spine without having to delete the hiden layers? Adobe generate is great, but then I can't get a json from photoshop. I am struggling.

Thanks for the script anyway,

Thanks Nate! Actually I found that one of my problem was that some layers had the same name. I had a set of different options and had the same layers named the same way by in different positions, and it seems that that was a problem.

Actually strange enough I think that the fact that the script stops when empty layers, it was good for me, because it allowed me to detect empty layers that are a bug.

What I think it would be awesome is that at the end of the export, get a report that there has been empty layers, to track down errors on large documents.

just a suggestion. Thank you.


I found a possible bug on the latest version of the png export. If you have a layer that has ":" in it, the script stops. So it is not possible to use it with the "png express" plug in, since each layer that is exported by the png Express adds "PNG:" to the layer.

Script updated to strip :. 🙂

2년 후

Hi there! I'm getting an error message in CS6 when I run the script it says
Error 22: Window does not have a constructor.
Line: 233
-> var dialog = new Window("dialog", "Spine LayersToPNG");
this is incredibly frustrating please help!