Re: [GD-DEVEL] Question about importing data from memory

[email protected] (Pierre)
Newsgroups php.gd.devel
Message-ID <[email protected]>
Hi Jeff,

On Nov 28, 2007 5:02 PM, Jeff Cunningham <[email protected]> wrote:

> Thanks, Pierre. I'll look at that code. How do you handle Truecolor
> images?  From what I've seen in your code it looked like they still used
> an indexed palette, only a much bigger one. Is this not the case? I
> definitely need to be working with 24-bit color (8-bits per r,g,b gun).

Palette based images store the index of the palette entry in the image
arrays (one per channel). Truecolor images have the color values
stored directly in the buffer. The format is 31bit RGBA, 8 bit for R,
G or B and 7 for the alpha. You can see the exact mask in gd.h. The
size of the buffer is width * eight * sizeof(int).

> Yes, if you want to give me a prototype for gdImageCreateFromData, I
> would be happy to help in any way I can.

ok, I will give it a try this week or early next week.

Regards,
--Pierre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.