You are here: croping an image with GD and putting it into html code « PHP « IT news, forums, messages
croping an image with GD and putting it into html code

Posted by Frank Arensmeier on 03/15/05 12:10

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@nikehydraulics.se
www.nikehydraulics.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация