mogrify 用括号调整文件名大小
在 php 中,调整包含“(”括号的文件名大小时失败。
通常我会这样做,
exec("mogrify -resize {$filewidth}x{$fileheight}! \"$file\"");
但它不适用于
命令行中带括号的文件名,必须像这样转义才能工作。
mogrify -resize 203x126!53v-slave -only\(2\).png
如何通过exec()
命令修复php的问题
注意文件名必须使用括号。
谢谢。
in php it failed when resize file name that include "(" bracket.
normally I do
exec("mogrify -resize {$filewidth}x{$fileheight}! \"$file\"");
but it don't work with filename with bracket
by command line have to escape like this for working.
mogrify -resize 203x126! 53v-slave-only\(2\).png
how to fix it for php by exec()
command
note filename must use bracket.
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 escapeshellcmd 和 escapeshellarg 使用与命令行配合使用的函数时。
例如:
Try to use escapeshellcmd and escapeshellarg when using functions that works with the command line.
For example: