Jump to content


Photo

Playing With Images.. Question/Problem..


  • Please log in to reply
1 reply to this topic

#1 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 31 May 2006 - 03:00 PM

ok so here is the function to upload, and resize an image:

    function resize_image ($new_width,$new_height,$source_path,$dest_path,$src_image) {    
        $dest_image_name = $src_image;
            
        $destimg=ImageCreateTrueColor($new_width,$new_height);
        $srcimg=ImageCreateFromJPEG($source_path.$dest_image_name) or die ("Problem Opening Source Image");
        
        ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die ("Problem In Resizing");
        
        ImageJPEG($destimg,$dest_path.$dest_image_name) or die ("Problem With Saving");
        
        return(true);
    }

But the images uploaded are completely the wrong colour pallet. They are crappy looking!! how do i keep the same pallet as the originals??

http://thewebsolutionprovider.com - A Solution For Everything Web!

#2 rathfon

rathfon
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 31 May 2006 - 05:27 PM

Try setting the quality in the imageJPEG? Hm.. Lemme know.

Like: ImageJPEG($destimg,$dest_path.$dest_image_name, 100)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users