I think you'll want to use the 'imagecopyresized' function. Something like
this:

    $thumbnail = imagecreate(100, 100);
    $original = imagecreatefromjpeg("uploadedfile.jpg");
    imagecopyresized($thumbnail, $original, 0, 0, 0, 0, 100, 100,
imagesx($original), imagesy($original));
    imagejpeg($thumbnail, "thumb.jpg");

That would create a 100x100 thumbnail image with no scaling, but you get the
idea! I do have the code that returns the uploaded image filename somewhere,
and I'll hunt that out if you like.

Thanks
Richard

-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED]
Sent: 05 April 2004 15:54
To: [EMAIL PROTECTED]
Subject: [PHP] Re: imagecreatefromjpeg


Jason -

I would like to give users the ability to upload jpeg images and have my 
php app size them into thumbnails as well as have a larger image 
available if the thumbnail is clicked.

Are there examples of this available?

Todd

Jason Barnett wrote:

>  From http://www.php.net/manual/en/function.imagecreatefromjpeg.php
> 
> To all those having trouble with a message to the effect of:<br>
> CreateImageFromJpeg() not supported in this PHP build<br>
> Start by adding --with-jpeg-dir to your ./configure options as I left 
> this out (not knowing I needed it) and I spent the best part of 6 hours 
> trying to compile to get this option. (RH 6.2, PHP 4.0.1pl2, Apache 
> 1.3.12, GD 1.8.3)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to