|
|
|
|
|
|
|
![]() |
#1 |
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
|
Would have edited previous message, but option was not there as it was a "Quick Reply"
Any way, I played with this and moved the imageCreateFromJPEG function above the image sizing functions. Also used full paths. So try this: Code:
function do_thumbs( $fn ){ $img_src = "/home/user/rep_pics/large/".$fn; $med_height = 250; $med_width = 200; $med_dest = "/home/user/rep_pics/medium/".$fn; $sml_height = 125; $sml_width = 100; $sml_dest = "/home/user/rep_pics/small/".$fn; $med_source_handle = imageCreateFromJPEG($img_src); if(!$med_source_handle){ die("couldn't get the source handle - $img_src"); } $sml_source_handle = imageCreateFromJPEG($img_src); if(!$sml_source_handle){ die("couldn't get the source handle - $img_src"); } $src_height = ImageSY($med_source_handle); $src_width = ImageSX($med_source_handle); $med_image = imageCreateTrueColor( $med_width, $med_height ); imageCopyResampled($med_image, $med_source_handle, 0, 0, 0, 0, $med_width, $med_height, $src_width, $src_height ); imageJPEG($med_image, $med_dest, 90); chmod($img_src, 0777); imageDestroy($med_image); imageDestroy($med_source_handle); $src_height = ImageSY($sml_source_handle); $src_width = ImageSX($sml_source_handle); $sml_image = imageCreateTrueColor( $sml_width, $sml_height ); imageCopyResampled($sml_image, $sml_source_handle, 0, 0, 0, 0, $sml_width, $sml_height, $src_width, $src_height ); imageJPEG($sml_image, $sml_dest, 90); chmod($img_src, 0777); imageDestroy($sml_image); imageDestroy($sml_source_handle); }
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare. |
![]() |
![]() |
![]() |
#2 |
Internet! Is that thing still around?
Join Date: Nov 2005
Posts: 3
|
Ya I got it figured out finally. My host had error messages turned off so it was a pain in the ass to figure out.. I finally got GD set up right on my local test bed and it all started making sense
![]() Code:
function do_thumbs( $fn ){ $img_src = "../rep_pics/large/$fn"; $med_height = 250; $med_width = 200; $med_dest = "../rep_pics/medium/".$fn; $sml_height = 125; $sml_width = 100; $sml_dest = "../rep_pics/small/".$fn; $source_handle = imageCreateFromJPEG($img_src); $src_height = ImageSY($source_handle); $src_width = ImageSX($source_handle); $med_image = imageCreateTrueColor( $med_width, $med_height ); imageCopyResampled($med_image, $source_handle, 0, 0, 0, 0, $med_width, $med_height, $src_width, $src_height ); imageJPEG($med_image, $med_dest, 90); chmod($med_dest, 0777); imageDestroy($med_image); $sml_image = imageCreateTrueColor( $sml_width, $sml_height ); imageCopyResampled($sml_image, $source_handle, 0, 0, 0, 0, $sml_width, $sml_height, $src_width, $src_height ); imageJPEG($sml_image, $sml_dest, 90); chmod($sml_dest, 0777); imageDestroy($sml_image); } |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|