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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.