Bad picture colors
| From: | nikos | Date: | Thu, 27 Apr 2006 16:27:43 +0000 |
| Subject: | Bad picture colors | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-41758@lists.php.net to get a copy of this message | ||
Hello list
I use the following code to shrink some photos.
$directory='/var/www/html/offroads/tmp/';
$dir=opendir($directory);
while($file=readdir($dir)) {
$dirfile=$directory.$file;
if(is_file($dirfile)) {
copy($dirfile,$directory."sm/sm_".$file);
$imgReal = ImageCreateFromJPEG($dirfile);
$x = ImagesX($imgReal);
$y = ImagesY($imgReal);
$newX=$x*0.1783;
$newY=$y*0.1783;
$img = ImageCreate($newX,$newY);
ImageCopyResized($img, $imgReal, 0, 0, 0, 0, $newX,
$newY, $x, $y);
//$newimg=imagecolorstotal($img);
ImageJPEG($img,$directory."sm/sm_".$file);
clearstatcache();
}
}
closedir($dir);
My problem is that the color results are very bad. How can I take picture
with good colors?
Thank you