note 32818 modified in function.imagecreatetruecolor by didou

From: Date: Fri, 20 Jun 2003 12:38:08 +0000
Subject: note 32818 modified in function.imagecreatetruecolor by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-50735@lists.php.net to get a copy of this message
I just fiddled around with Phpix, which had some problems using the GD lib (washed out colours). I changed the lines, which did the trick. Just in case some of you are still having problems and you can't change the PHP-install on the hosting side: $im = ImageCreateFromJPEG($source); $new_im = ImageCreate($new_width,$new_height); ImageCopyResized($new_im,$im,0,0,0,0, $new_width,$new_height,ImageSX($im),ImageSY($im)); TO $im = ImageCreateFromJPEG($source); $new_im = ImageCreateTrueColor($new_width,$new_height); ImageCopyResized($new_im,$im,0,0,0,0,$new_width, $new_height,ImageSX($im),ImageSY($im)); --was-- I just fiddled around with Phpix, which had some problems using the GD lib (washed out colours). I changed the lines, which did the trick. Just in case some of you are still having problems and you can't change the PHP-install on the hosting side: $im = ImageCreateFromJPEG($source); $new_im = ImageCreate($new_width,$new_height); ImageCopyResized($new_im,$im,0,0,0,0, $new_width,$new_height,ImageSX($im),ImageSY($im)); TO $im = ImageCreateTrueColorFromJPEG($source); $new_im = ImageCreateTrueColor($new_width,$new_height); ImageCopyResized($new_im,$im,0,0,0,0,$new_width, $new_height,ImageSX($im),ImageSY($im)); http://www.php.net/manual/en/function.imagecreatetruecolor.php

« previous php.notes (#50735) next »