Jump to content

Recommended Posts

Posted

I have downloaded a simple php code for an online photo album. This script has everything I need except the autocreation of thumbnails. The author appears to have attempted to include support for this but has commented out the lines and when uncommented.. it still doesnt work

I am mildly familiar with php.. normally getting code and modifying it to fit my needs but I am by no means a programmer.

The he has commented out is as follows

// THUMBNAIL DOESN'T EXIST - LET'S CREATE ONE! (Fun, Eh?)
// $new_w=100;
// $new_h=100;
// header("Content-type: image/gif");
// $dst_img=ImageCreate($new_w,$new_h);
// $src_img=ImageCreateFromGif("./imgtest.gif");
// ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
// ImageGif($dst_img);

I am using jpg instead of gif's so I attempted to modify the code for jpg but am unsuccessful. I keep ending up with gibberish

here is my code

//THUMBNAIL DOESN'T EXIST - LET'S CREATE ONE! (Fun, Eh?)
$new_w=100;
$new_h=100;
header("Content-type: image/jpeg");
$dst_img=ImageCreateTrueColor($new_w,$new_h);
$src_img=ImageCreateFromJpeg("$photoDir/&photoFile");
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
ImageJpeg($dst_img,'',100);

here is the url to the full code

http://www.ravis.org/code/album/

I have been messing with this for hours and I continually end up with this http://danfrei.com/beta/photoalbum/1/index...hotoDir=kitten/

anybody with any ideas?


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...