我正在尝试完成我的图像上传器,它利用 imagick 来处理各种图像类型。我试图开始工作的一件事是将 jpeg 文件转换为渐进式 jpeg。我已经尝试了下面的代码,但是当我查看在 irfranview 中输出的图像时,jpeg 不是渐进的。有任何想法吗?
foreach ($thumbnailScaleWidths as $thumbnailScaleWidth) {
$thumbnail = new imagick($uploadedFile['tmp_name']);
$thumbnailDimensions = $thumbnail->getImageGeometry();
$thumbnailWidth = $thumbnailDimensions['width'];
$thumbnailHeight = $thumbnailDimensions['height'];
$thumbnailScaleHeight = ($thumbnailScaleWidth / $thumbnailWidth) * $thumbnailHeight;
$thumbnail->thumbnailImage($thumbnailScaleWidth, $thumbnailScaleHeight);
$thumbnail->setImageInterlaceScheme(Imagick::INTERLACE_PLANE);
$thumbnail->writeImages($_SERVER['DOCUMENT_ROOT'] . "/Resources/Media/$userId/$internalName-$thumbnailScaleWidth.$fileType", true);
}
关于为什么这不输出渐进式 jpeg 的任何想法?