RE: [PHP] PHP Image Functions
| From: | joakim dot andersson at cybercom dot se | Date: | Tue, 09 Jul 2002 10:24:43 +0000 |
| Subject: | RE: [PHP] PHP Image Functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-106322@lists.php.net to get a copy of this message | ||
Well, you're halfway there...
You just have to separate the image-script from the rest like this:
image_spewing_script.php:
<?php
$x = 130;
$y = 100;
$quality = 75;
$thumbnail = imagecreate($x, $y);
$originalimage = imagecreatefromjpeg('test.jpg');
imagecopyresized($thumbnail, $originalimage, 0, 0, 0, 0, $x, $y,
ImageSX($originalimage),ImageSY($originalimage));
header("Content-Type: image/jpeg");
imagejpeg($thumbnail,'test.jpg',$quality);
imagedestroy($thumbnail);
?>
and in the other file (your actual page):
</tr>
<td><img alt="text" src="image_spewing_script.php"
valign="top"
/></td>
</tr>
Regards
Joakim Andersson
> -----Original Message-----
> From: Mark Colvin [mailto:mark.colvin@ccmltd.co.uk]
> Sent: Tuesday, July 09, 2002 11:27 AM
> To: Php (E-mail)
> Subject: [PHP] PHP Image Functions
>
>
> I have a directory of jpegs that I want to display thumbnails
> of and have a
> link to the original jpeg. I would rather not create separate
> thumbnails
> images preferring to create them in memory to display them. I
> have installed
> GD v.1.8.4. The code below outputs jumbled text to the
> browser (possibly the
> jpeg stream?). Code is as follows:
>
> Why will this not work?
>
>
> ****************************************************
> This e-mail is intended for the recipient only and
> may contain confidential information. If you are
> not the intended recipient then you should reply
> to the sender and take no further ation based
> upon the content of the message.
> Internet e-mails are not necessarily secure and
> CCM Limited does not accept any responsibility
> for changes made to this message.
> Although checks have been made to ensure this
> message and any attchments are free from viruses
> the recipient should ensure that this is the case.
> ****************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>