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

[email protected] (Miguel Maldonado)
Newsgroups php.gd.devel
Message-ID <[email protected]>
Thanks for the prompt response.  I will take the liberty to shoot a  
couple of more questions:

1)  Does gd support Tif images, If not are there plans to add this  
feature ?

2) Is there a way to calculate the appropriate pixel dimensios of a  
jpg image by for a particular file size.  For example I would like to  
resize all images in a folder to 20 KB.

Thanks again,

Miguel Maldonado

On Jan 17, 2007, at 9:08 PM, Pierre wrote:

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