croping an image with GD and putting it into html code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I ran into a little problem today and I would like to get some help. I create a thumbnail image with GD from a jpeg image stored on my web-server with this function:

function thumb($img_scr) {
$thumbWidth = 100;
$thumbHeight = 100;
$scourceImg = @imagecreatefromjpeg($img_scr);
$thumbImg = @imagecreate($thumbWidth, $thumbHeight);
@imagecopyresized($thumbImg, $sourceImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($img_scr), imagesy($img_scr));
@imagejpeg($thumbImg);
}


This function will return only the raw data for the new thumbnail image. Is there a way to output the thumbnail image directly to a <img> tag in my html file? Is there a way to do this without storing the thumbnail into a tmp file?

/frank


________________________________________________ Frank Arensmeier Marketing Support

NIKE HYDRAULICS AB
Box 1107
631 80 Eskilstuna
Sweden

tel +46 16 82 34
fax +46 16 13 93 16
email: frank.arensmeier@xxxxxxxxxxxxxxxxx
www.nikehydraulics.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux