Page 1 of 1

Is there C-API to load psd buffer specify layer

Posted: 2016-01-13T23:33:54-07:00
by kayaklee
I got image through network as a buffer.

I want load the buffer and specify the zero layer,but I have not found the C-API

So I have to write the buffer to local file,and load it from the filename like "lena.jpg[0]"

Is there C-API to load psd buffer specify layer, if not could you add one?

Re: Is there C-API to load psd buffer specify layer

Posted: 2016-01-15T13:36:09-07:00
by ggarra13
To get the number of layers (images):

size_t numLayers = MagickGetNumberImages( wand );

MagickSetIteratorIndex(wand, index) allows you to travel through all PSD layers.

You can obtain the name of the layer using:

const char" label = MagickGetImageProperty( wand, "label" );

Re: Is there C-API to load psd buffer specify layer

Posted: 2016-01-18T21:20:33-07:00
by kayaklee
Thanks!

But it does not solve my problem. You must get a wand initialized from the buffer.

I have a buffer read from psd file, it is too slow and allocate too much memory while initializing wand from the whole buffer.

So I want to initialize wand from 0-layer of the buffer.