Subject: Re: reducing the size of an image
To: None <port-amiga@NetBSD.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: port-amiga
Date: 06/10/2004 21:31:34
--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

On Wed, Feb 18, 2004 at 10:41:35AM -0500, admin@datazap.net wrote:

> If I wanted to reduce jpeg's from a web interface would there be a better
> option? I tried php4-gd, and it is just to slow. I am consider calling
> djpeg -fast -scale 1/4 image.jpg | cjpeg > image_reduced.jpg from a php
> script.

This is the correct way...

note that djpeg only supports -scale 1/2, 1/4 and 1/8 because it makes use
of the 8x8 block nature of the jpeg data. That's why it is fast; it only
does a partial inverse cosine transform, thus gets the scaling with less
effort than pure decoding alone to the original size would be (and
additionally, it saves the scaling operation).

So no help there...  if you need a different scale factor, you have to do
djpeg | pnmscale | cjpeg, for example.

Regards,
	-is

--liOOAslEiF7prFVr
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAyLcWN4tiz3B8hB0RApXkAKCUS4Tgd0SLt8+s5mu1oQuo3XIXjwCgzAOU
ykszTtYz/nuggoKwzomhbyM=
=Lgnu
-----END PGP SIGNATURE-----

--liOOAslEiF7prFVr--