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

From: Date: Thu, 18 Jan 2007 01:08:13 +0000
Subject: Re: [GD-DEVEL] Defining JPG DPI and Bit Depth Parameters
References: 1  Groups: php.gd.devel 
Request: Send a blank email to php-gd-devel+get-46@lists.php.net to get a copy of this message
Hi Miguel, On 1/18/07, Miguel Maldonado <miguelmal@gmail.com> 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

« previous php.gd.devel (#46) next »