Jump to content

PHP Gallery


emediastudios

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/145545-php-gallery/
Share on other sites

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]

 

Link to comment
https://forums.phpfreaks.com/topic/145545-php-gallery/#findComment-764918
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.