白色图像上的phpThumb(imagecreatefromjpeg)生成#fefefe条纹

白色图像上的phpThumb(imagecreatefromjpeg)生成#fefefe条纹,php,image,phpthumb,Php,Image,Phpthumb,我在使用phpThumb(或任何其他图像大小调整库)生成拇指时遇到了一个大问题 首先,让我向您展示可见的问题: (这是生成的图像) (这是源图像) 如您所见,图像更大,它是通过php thumb、100%qualiti、fill color生成的 源图像的背景为纯白色,但生成图像的背景具有水平#fefefe条纹。这在水晶般清晰的显示器上是可见的,而且非常恼人 我想知道是否有人有这个问题,是否有解决这个错误的方法 生成的其他尺寸: 提前谢谢你 以下是我生成缩略图的方法,欢迎您尝试: he

我在使用phpThumb(或任何其他图像大小调整库)生成拇指时遇到了一个大问题

首先,让我向您展示可见的问题: (这是生成的图像) (这是源图像)

如您所见,图像更大,它是通过php thumb、100%qualiti、fill color生成的

源图像的背景为纯白色,但生成图像的背景具有水平#fefefe条纹。这在水晶般清晰的显示器上是可见的,而且非常恼人

我想知道是否有人有这个问题,是否有解决这个错误的方法

生成的其他尺寸:


提前谢谢你

以下是我生成缩略图的方法,欢迎您尝试:

header("Content-type: image/jpeg");
$collection = $_GET['collection'];
$ref        = $_GET['ref'];
$maxthumb=100;
$filename=DirectoryNameFromCollectionNumber($collection) . "/" . $ref . ".jpg";
$size = getimagesize($filename);
$ratio = $size[0]/$size[1]; // width/height
if( $ratio > 1) {
    $width = $maxthumb;
    $height = $maxthumb/$ratio;
}
else {
    $width = $maxthumb*$ratio;
    $height = $maxthumb;
}
$src = imagecreatefromstring(file_get_contents($filename));
$dst = imagecreatetruecolor($width,$height);
imagecopyresampled($dst,$src,0,0,0,0,$width,$height,$size[0],$size[1]);
imagedestroy($src);
imagejpeg($dst);
imagedestroy($dst);