corillo181 Posted June 2, 2007 Share Posted June 2, 2007 so i downloaded that library because i was trying to make a thumbnail and i just found out that php 5 does not come with gd integrated and i downloaded it but i dont know what to do or where to put the files. Link to comment https://forums.phpfreaks.com/topic/54016-how-to-install-gd/ Share on other sites More sharing options...
per1os Posted June 2, 2007 Share Posted June 2, 2007 I am not sure with php5, but as long as there is a php_gd2.dll in the extensions directory you just need to add extension=php_gd2.dll to the php.ini file under the extension section or remove the ; from it. Link to comment https://forums.phpfreaks.com/topic/54016-how-to-install-gd/#findComment-267054 Share on other sites More sharing options...
corillo181 Posted June 2, 2007 Author Share Posted June 2, 2007 so why do i keep on getting this error imagesx(): supplied argument is not a valid Image resource in these is how i set it up upLoadPicture($galleryid,$picture,$descrive,$save,$width){ $widthx=imagesx($picture); $heighty=imagesy($picture); if($widthx>600){ $srcImg=imagecreatefromjpeg("$picture"); $ratio=$widthx/$width; $thumbHeight=$heighty*$ratio; $thumbImg=imagecreate($Width,$thumbHeight); imagecopyresized($thumbImg,$srcImg,0,0,0,0,$Width,$thumbHeight,imagesx($thumbImg),imagesy($thumbImg)); imagejpeg($thumbImg,"$save",100); echo "done!"; }else{ echo "could not do picture"; } } Link to comment https://forums.phpfreaks.com/topic/54016-how-to-install-gd/#findComment-267065 Share on other sites More sharing options...
per1os Posted June 2, 2007 Share Posted June 2, 2007 upLoadPicture($galleryid,$picture,$descrive,$save,$width){ $srcImg=imagecreatefromjpeg($picture); $widthx=imagesx($srcImg); $heighty=imagesy($srcImg); if($widthx>600){ $ratio=$widthx/$width; $thumbHeight=$heighty*$ratio; $thumbImg=imagecreate($Width,$thumbHeight); imagecopyresized($thumbImg,$srcImg,0,0,0,0,$Width,$thumbHeight,imagesx($thumbImg),imagesy($thumbImg)); imagejpeg($thumbImg,"$save",100); echo "done!"; }else{ echo "could not do picture"; } } I think that is it. www.php.net/imagecreate www.php.net/imagecreatefromjpeg They both return an image resource which in return is used for the imagesx and y function Link to comment https://forums.phpfreaks.com/topic/54016-how-to-install-gd/#findComment-267076 Share on other sites More sharing options...
corillo181 Posted June 2, 2007 Author Share Posted June 2, 2007 yeah i just notice that but I'm train to get the image width and height and i think I'm doing something wrong because nothing works. if(isset($_POST['Upload'])){ $save='/image'; $galleryid=$_POST['galleries']; $picture=$_POST['fileField']; $descrive=$_POST['textfield']; //upLoadPicture($galleryid,$picture,$descrive,$save,600); $a=getimagesize($picture); $width = $a[0]; $height = $a[1]; echo $width.$height; } Link to comment https://forums.phpfreaks.com/topic/54016-how-to-install-gd/#findComment-267091 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.