我如何使用PHP的ImageMagick二进制文件? [英] How do I use ImageMagick binaries from PHP?
本文介绍了我如何使用PHP的ImageMagick二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在本地使用ImageMagick库进行图像编辑。在我的在线共享服务器中没有安装ImageMagick但是在请求之后,他们在 / usr / local / bin
安装了ImageMagick二进制文件,例如在 / usr / local / bin / convert
的转换
二进制文件。
I am using locally the ImageMagick library for image editing. In my online shared server there was no ImageMagick installed but after requested, they installed ImageMagick binaries at /usr/local/bin
, e.g. the convert
binary at /usr/local/bin/convert
.
如何在我的脚本中使用这些二进制文件?
How can I use those binaries in my script?
推荐答案
使用exec类似
$inputFile = 'file.jpg';
$outputFile = 'file.png';
exec('/usr/local/bin/convert '.$inputFile.' '.$outputFile);
这篇关于我如何使用PHP的ImageMagick二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文