使用 Imagick->resize() 创建的小图像的大缩略图尺寸

发布于 2024-12-10 17:53:02 字数 781 浏览 0 评论 0原文

好的,我有一个简单的 PHP 脚本,它使用 Imagick PHP 扩展生成大图片的缩略图。

简化的脚本是:

$this->image = new Imagick ();
$this->image->readImage($origFileName);

$this->image->resizeImage(76, 50, Imagick::FILTER_CATROM, $this->blur);
$this->image->contrastImage( 1 );
$this->image->sharpenimage( 0.8, 0.6);

$this->image->setImageCompression(imagick::COMPRESSION_JPEG);
$this->image->setImageCompressionQuality(1); // REALLY strong JPEG compression

生成的图像相当难看(当然是这样!): http://dl.dropbox.com/u/16514036/thumbnail.php.jpg

但看看大小 - 它是28 KB!糟糕,什么?!

据我了解,问题出在 Photoshop 的元数据或嵌入预览中。

所以问题是 - 如何优化缩略图并从中删除所有过时的数据?

Ok, I have a simple PHP script, that generates a thumbnail for a large picture using Imagick PHP extension.

The simplified script is:

$this->image = new Imagick ();
$this->image->readImage($origFileName);

$this->image->resizeImage(76, 50, Imagick::FILTER_CATROM, $this->blur);
$this->image->contrastImage( 1 );
$this->image->sharpenimage( 0.8, 0.6);

$this->image->setImageCompression(imagick::COMPRESSION_JPEG);
$this->image->setImageCompressionQuality(1); // REALLY strong JPEG compression

The resulting image is quite ugly (of course it is!):
http://dl.dropbox.com/u/16514036/thumbnail.php.jpg

But look at the size - it is 28 KB! Crap, what?!

As far as I understand the problem is in metadata or embed preview from Photoshop.

So the question is - how can I optimize thumbnail and remove all obsolete data from it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文