emediastudios Posted February 17, 2009 Share Posted February 17, 2009 I wanted to add a php/sql gallery to my site. I do have a script that uploads images to a dir and puts the record in a table in sql, but it doesnt resize the image, and i wanted to know if someone would be so kind to share a script with me if they did. I need the thumbnail generation feature. I am proficient in flash, maybe we could swap some work? Quote Link to comment https://forums.phpfreaks.com/topic/145545-php-gallery/ Share on other sites More sharing options...
angelcool Posted February 18, 2009 Share Posted February 18, 2009 Here: Here, [code]<?php // Create source image and dimensions $src_img =imagecreatefromgif("bulb_gif.gif"); $srcsize = getimagesize('bulb_gif.gif'); $dest_x = 50; $dest_y = (50/ $srcsize[0]) * $srcsize[1]; $dst_img = imagecreatetruecolor($dest_x, $dest_y); //$white = imagecolorallocate($dst_img,255,255,255); imagefill($dst_img, 0, 0, $white); // Resize image //imagecolortransparent($dst_img,$white); //imagealphablending($dst_img, 0); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_x, $dest_y, $srcsize[0], $srcsize[1]); // Output image header("content-type: image/png"); imagegif($dst_img,'',100);//imagejpeg($dst_img,"",85); // Destroy images imagedestroy($src_img); imagedestroy($dst_img); ?> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/145545-php-gallery/#findComment-764918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.