[pmwiki-users] Best Place to Resize an Image . . .
Joachim Durchholz
jo at durchholz.org
Tue Apr 11 02:33:33 CDT 2006
H. Fox schrieb:
> On 4/10/06, Ben Wilson <dausha at gmail.com> wrote:
>> I want to automatically create thumbnails of uploaded images when they
>> exceed a certain size. I know "how" to do this, since I used to do the
>> same thing to images up to 4.5GB in size.
>
> Using a web server? If so, I'm very curious how you are doing that.
Use gdlib. It's part of the standard install of PHP (see
http://www.php.net/manual/en/ref.image.php ).
The usual sequence is:
* getimagesize (also provides the image type)
* imagecreatefromgif/imagecreatefromjpeg/imagecreatefrompng
* imagecreatetruecolor (with the intended target size)
* imagecopyresampled (fallback: imagecopyresized)
* imagegif/imagejpeg/imagepng
Regards,
Jo
More information about the pmwiki-users
mailing list