用于调整图像大小和创建缩略图的 ImageMagick 或 GD 库?
我一直在使用其他人编写的图像调整大小类来调整图像大小或创建缩略图,这是我一直在使用的类的链接。
http://www.white-hat-web -design.co.uk/articles/php-image-resizing.php
我猜图像GD库对图像的分辨率或文件大小有一些限制,它适用于低分辨率图片调整大小(低于1024px)但如果我尝试粗略地上传高分辨率 jpeg 图像(即 3400px X 2200px),它不会调整大小,
调整图像大小的目的是我正在开发一个图片库应用程序。
有什么方法可以绕过图像 gd 库施加的限制(我在共享托管上对系统文件进行任何更改,我的主机不会同意)。 ?
或者我应该使用 imageMagick 来达到此目的(我的主机已经安装了 imageMagick)?我不太熟悉使用 imageMagick 是否有任何内置插件或类可以用于此目的?
有没有任何可以完成我的工作的 jquery 插件的推荐?
谢谢
I had been using the image resize class written by someone else to resize images or to create the thumbnails, here is the link to the class I had been using.
http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
I guess image GD library has some limitations for the resolution or the file size of images, it works fine for low resolution picture resizing(below 1024px) but it does not resize if I try to upload the high resolution jpeg image (i.e 3400px X 2200px) roughly,
The purpose for resizing the image is i am developing a picture gallery application.
Is there any way I could bypass the limit put on by the image gd library (I am on shared hosting any changes to the system file my host wont agree). ?
Or is is that I should be using the imageMagick for this purpose(my host have installed imageMagick)? I am not so familiar with using imageMagick is there any built in plugin or class I could use for this purpose?
Is there any reccomendation for any jquery plugin that could do my work?
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 imagecopyresized 函数,
这是内置的,
不需要重新编译(您的共享托管会很高兴),
并为图像处理提供几乎简单的功能
Jquery 是客户端 javascript 库,
它对图像处理没有帮助
Try the imagecopyresized function,
which is built in,
need not to re-compile (your share hosting will be happy),
and provide almost simple feature for image processing
Jquery is clients javascript library,
it does not help with image processing
问题是,如果您尝试使用 GD 库调整非常大的图像大小,您的内存会变满。
你应该使用 ImageMagick。
使用以下代码
因此,如果您想调整最大尺寸为 64x64 的 logo.gif 并将其重命名为 resize_logo.gif
有关详细信息,请遵循此 链接
The problem is that your memory is getting full if you try to resize a very large image with GD library.
You sould use ImageMagick.
use the following code
So if you want to resize logo.gif with a maximum size of 64x64 and rename it to resize_logo.gif
For more information follow this link