Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-11-24, 10:16 AM   #4
Subway
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 . Here's the 'finished' code if anyone ever needs it.

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);
}
Subway is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:56 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc