PHP GDimagecopyresampled()
関数を使用して画像をトリミングしました。以前はこの機能を使っていたのですが、どうやらFirefoxやChromeなどのブラウザ(どちらも最新版)では画像がトリミングされず、削除すべき部分が透けて見えるようになりました。
OSX ファインダーと Photoshop は正しい画像サイズを表示し、透明度はありません...
何が間違っている可能性がありますか?
これはjpg画像のコードです...
if(!($sourceImage = @imagecreatefromjpeg($source)))
{
$image = imagecreate($width, $height);
$colorWhite = imagecolorallocate($image, 255, 255, 255);
$colorBlack = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $colorWhite);
imagestring($image, 1, 1, 10, "Immagine non disponibile", $colorBlack);
imagejpeg($image, $destination);
return(FALSE);
}
$destinationImage = imagecreatetruecolor($width, $height);
imagecopyresampled($destinationImage, $sourceImage,0,0,$x,$y,$width,$height,$width,$height);
imagejpeg($destinationImage, $destination);