thumb script
Posted: Mon Sep 13, 2004 7:53 pm
feyd | Please use
Returns 4 errors. All stemming from the fact that it is not finding the file/path associated with $fullNameThumb. If I substitute $fullName for $fullNameThumb, there are no erros reported but the thumb script produces nothing.
I tried using the normal copy function with $fullNameThumb (you'll see it commented out) to try and create the image for temporary use in the thumb script... No luck.
I have checked and the GD library is installed and the proper version too, phpinfo();
here is the entire script thus far:
Thanks in advance for any help.
1M.
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello. I have searched the thumbnail scripts and threads here and haven't found anything to point me in the right direction yet. I am having GREAT difficulties getting this script to work. THe full sized image upload is working... the thumbnail is NOT AT ALL. Any help would be greatly appreciated.
Right now the line:Code: Select all
$src_img=imagecreatefromjpeg($fullNameThumb);I tried using the normal copy function with $fullNameThumb (you'll see it commented out) to try and create the image for temporary use in the thumb script... No luck.
I have checked and the GD library is installed and the proper version too, phpinfo();
here is the entire script thus far:
Code: Select all
if (@$file) {
//declare var for photo file name for db
$photo_file = $file['name'];
//sql
$query = " INSERT into photos (photo_file, photo_date, photo_desc)
VALUES ('$photo_file', '$date', '$desc')";
$result = mysql_query($query, $conn) or die(mysql_error());
//path name vars
$abspath = $HTTP_SERVER_VARS['PATH_TRANSLATED'];
$stub=ereg_replace("/photoAdd.php","/",$abspath);
// use $fullname for the resulting path for file uploads, based on any changes you make above
$fullname = $stub ."/images/photos/".$file['name'];
$fullNameThumb = $stub ."/images/photos/thumbs/".$file['name'];
//copies full sized image
copy($file['tmp_name'],$fullname);
//copy($file['tmp_name'],$fullNameThumb);
//begin thumbnail script
$src_img=imagecreatefromjpeg($fullNameThumb);
$old_x=imagesx($src_img);
$old_y=imagesy($src_img);
$thumb_w=50;
$thumb_h=50;
$dst_img = imagecreatetruecolor($thumb_w,$thumb_h);
//echo $src_img;
imagecopyresampled($dst_img,$src_img,0,0,0,0,$th
umb_w,$thumb_h,$old_x,$old_y);
//imagedestroy($dst_img);
//imagedestroy($src_img);
}1M.
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]