Re: [GD-DEVEL] Defining JPG DPI and Bit Depth Parameters

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

On 1/18/07, Miguel Maldonado <[email protected]> wrote:
> Hi,
>
> I'm new to using the gd library.  My goal is to batch resize a large
> number of jpg images.  Using the examples in the documentation I can
> easily reduce the size of the images but I'm not able to maintain the
> values for the DPI and the Bit Depth for the image. While the original
> image has a DPI of 200 and a Bit Depth of 1 the resized image has the
> default resolution of 96 and a Bit Depth of 8.

GD supports only palette (256 colors) and truecolor images (31biits
rgba). That's why the resulting image is not 1bit anymore, it is
transformed at load time.

The dpi is a descriptive informations but does not affect the image
contents itself. A 100x100 dot buffer will be 100x100 in the jpeg
buffer.

However it is useful to be able to keep the meta data while loading an
image. I will try to provide some basic functions in 2.1.0.

I hope I answered your questions.

Cheers,
--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.