image icon indicating copy to clipboard operation
image copied to clipboard

Read text from PsdLayer

Open sumitgohil opened this issue 3 years ago • 3 comments

I've a layer that contains just text. Is there a way to read the text layer?

sumitgohil avatar Nov 13 '20 17:11 sumitgohil

You might be able to by getting the PsdImage and looking at its PsdLayers.

var psd = PsdImage(bytes);
psd.decode();

psd.layers has the layers, and you can check if there's any useful data in there

brendan-duncan avatar Nov 22 '20 06:11 brendan-duncan

@brendan-duncan All the text layers are converted into image I guess. Raw text could not be extracted. Also, Font used and other such details.

sumitgohil avatar Nov 22 '20 14:11 sumitgohil

If you send me the psd and what info you're looking for, I can take a look. There's no text to image conversions happening. PSD is a particular format, not really designed for anything but use with Photoshop. The decoder in this library doesn't render the PSD, but PSD files include a pre-rendered image within them that the decoder is extracting. The other information could possibly be in the PsdImage class somewhere, though, having been extracted in the process.

brendan-duncan avatar Nov 22 '20 17:11 brendan-duncan