使用 Imagick->resize() 创建的小图像的大缩略图尺寸
好的,我有一个简单的 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
元数据可以通过 http://php.net/manual/en/function 进行清理.imagick-stripimage.php
Meta data can be cleaned by http://php.net/manual/en/function.imagick-stripimage.php