Is there C-API to load psd buffer specify layer

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
kayaklee
Posts: 8
Joined: 2015-12-07T17:44:46-07:00
Authentication code: 1151

Is there C-API to load psd buffer specify layer

Post 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?
ggarra13
Posts: 30
Joined: 2015-04-17T14:08:07-07:00
Authentication code: 6789

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

Post 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" );
kayaklee
Posts: 8
Joined: 2015-12-07T17:44:46-07:00
Authentication code: 1151

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

Post 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.
Post Reply