良好的图像调整框架
我目前正在 PHP 中调整图像大小,我当前的代码大约需要 2-2.2 秒(不包括上传时间)将图像大小调整为两种尺寸,一种是缩略图尺寸,一种是中等尺寸。 谁能推荐一个我可以下载的可以快速调整图像大小的框架或类?
谢谢。
I'm currently resizing images in PHP, and my current code takes about 2-2.2 seconds (not including upload time) to resize an image to two sizes, one thumbnail size, and one medium-sized.
Can anyone recommend a framework or class that I could download that would resize the images quickly?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经使用 ImageMagick 很长时间了,效果很好。
I have used ImageMagick for a long time, and it works great.
作为来自 Ruby 和本机方面的人,我建议避免基于 ImageMagick 的解决方案,因为它会占用大量内存,而且一开始就很慢。
我发现很多脚本语言倾向于包装三个免费图像库之一:ImageMagick、ImageScience 和 GraphicsMagick。 在调整图像大小方面,这三个库的性能都相对较差。 如果必须在三者之间进行选择,GraphicsMagick 具有最佳性能,而 ImageScience 消耗最少内存。
但是,在免费库中,我建议使用基于 VIPS 或 NetPBM 的库,它们速度更快,消耗的内存也少得多 比他们更受欢迎的同行。
如果钱不是问题,那么封装诸如适用于 Linux 的英特尔 IPP 之类的东西可能是最快的选择。 然而,IPP 约为 200 美元。
As someone coming from in the Ruby and native side of things, I would recommend avoiding ImageMagick based solutions since it eats large volumes of memory and happens to be slow in the first place.
I've found that a lot of scripting languages tend to wrap one of three free image libraries: ImageMagick, ImageScience and GraphicsMagick. All three of these libraries have relatively poor performance when it comes to image resizing. If you have to choose between the three, GraphicsMagick has the best performance while ImageScience consumes the least memory.
However, out of the free libraries, I'd suggest going with something based on either VIPS or NetPBM, which are a great deal faster and consume far less memory than their more popular counterparts.
If money isn't a problem, then wrapping something like Intel IPP for Linux will probably be the fastest alternative. However, IPP is about $200 USD.
我以前用过一次,效果很好
http ://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
不确定它是否比您已经拥有的更快。
Ive used this once before and it worked fine
http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
Not sure if its quicker that what you already have though.