GD 或 ImageMagick 已经成为客户端 PHP 安装的一部分的可能性有多大?
我正在开发一个包,其中包括 PHP 中图像的重新缩放。 对于图像重新缩放,PHP 有 GD 和 ImageMagick 库。 这些可能已经成为给定客户端 PHP 安装的一部分吗?
就此而言,PHP 是否有“默认”安装? 默认情况下,是否包含 GD 或 ImageMagick?
如果两者都没有安装,我是否应该有某种可怕的后备位置来读取、重新缩放和保存 GIF、JPG 和 PNG,或者将 GD 或 ImageMagick 添加到现有安装中是否很简单?
I'm working on a package which includes rescaling of images in PHP. For image rescaling, PHP has the GD and ImageMagick libraries. Are those likely to be part of a given client's PHP install already?
Is there a "default" install of PHP, for that matter? By default, are either GD or ImageMagick included?
If neither is installed, should I have some sort of horrible fallback position of reading, rescaling, and saving GIFs, JPGs, and PNGs, or is it simple to add GD or ImageMagick to an existing install?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我不记得我上次看到没有 GD 的 Lamp 托管提供商是什么时候了。 imagemagick 扩展并没有那么广泛。 如果他们自己运行服务器,他们确实应该能够激活其中之一或两者。 在你的位置,我将使用 GD 构建完整的功能和(可能减少的)imagemagick 后备。 如果他们都没有得到,向他们展示轮子和/或火的基本概念,他们应该感激不已。
PS:我遇到过停用某些 GD 功能的提供商(在共享托管环境上计算过于密集),例如 imagerotate 和 imagefilter。
i can't remember when i've last seen a lamp hosting provider without GD. the imagemagick extension is not that widespread. if they run their server themself, they really should be able to activate one of it or both. in your place i'd build the full functionality with GD and a (probably reduced) imagemagick fallback. if they got neither, show them the basic concepts of the wheel and/or fire, they should be grateful.
PS: i encountered providers that deactivated certain GD functions (computationally too intensive on a shared hosting environment), like imagerotate and imagefilter.
GD 是 php 中包含的最简单的库。它“只是”一个扩展,主要包含在 php 包中...唯一需要的操作是激活该扩展。
关于ImageMagik,它更加复杂,因为php imageMagik库只是imagemagik软件的一个接口。
使用 imageMagik 需要安装软件和 php 库
GD is the easiet library to include in php.. it is "only" an extension, mainly included in php packages... the only operation needed is to activate the extension.
Regarding ImageMagik, it is more complecated, since the php imageMagik library is only an interface for the image magik software.
Using imageMagik require both software and php library installed
期望客户有能力或了解如何添加库是合理的。 您是销售软件还是服务器维护?
如果你想要整个“易于使用”的角度,你会想要将 php 与你的应用程序打包(并且已经安装了 GD),我不确定这是否合法。 (但可能有一些方法可以完成它)
It is reasonable to expect the client to have the capability or an understanding of how to add the library. Are you selling software or servers maintenance?
If you're going for the whole "ease of use" angle, you'll want to package php with your app (and GD installed already), of which I'm not sure the legality. (but there's probably some way to get it done)
90% GD - 10% ImageMagick
90% GD - 10% ImageMagick
Windows - 是
Linux/MAC - 否(但相当容易安装)
Windows - Yes
Linux/MAC - No (but fairly easy to install)