【发布时间】:2015-08-21 09:07:14
【问题描述】:
这是我打算做的 GD 版本。它将图像放置在白色背景的中心。
$background = imagecreatetruecolor(709,709);
$whiteBackground = imagecolorallocate($background, 255, 255, 255);
imagefill($background,0,0,$whiteBackground);
imagecopyresampled(
$background, $new_img,(709-$imageWidth)/2,(709-$imageHeight)/2,
0, 0, $imageWidth, $imageHeight, $width, $height
);
ImageJpeg ($background,"$path/$newName.$file_ext", 85);`
但我希望使用 Imagick 进行。
【问题讨论】: