dpw5865 2019-05-01 10:39
浏览 105

在webapp调用脚本时加载模块失败,从cli运行时完全运行

I have a web app that uses MVC(yii2) running on Ubuntu/lampp. When the script attempts to run the identify method . It returns nothing, but the error_log is having some lines stating the fact that a module is missing. This error is only on PNG image format, on JPEG/JPG it runs perfectly.

Already tried reinstalling imagemagick and identify, but no result. Also the script is running perfectly when called from the command line.

The model function( getFullPath returns the correct value, it's not the problem here)

public function identify()
{
        $cmd = "identify -verbose " . $this->getFullPath();
        $cmd = str_replace(['(', ')'], ['\\(', '\\)'], $cmd);
        exec($cmd, $o);
        return $o;   
}

The script that runs perfectly(it's just a png downloaded from google, my files are not saved there)

<?php   
$cmd = "identify -verbose /home/timurmengazi/Downloads/O-Academy-rgbrev.png";
exec($cmd, $o);
print_r($o);
?>

Also, the lines from error_log

identify-im6.q16: unable to load module `/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7//modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1302.
identify-im6.q16: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/504.
identify: unable to load module `/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7//modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1302.
identify: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/504.

I am using this command to get image metadata, like compression type, quality of compression and other stuff.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
    • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
    • ¥15 lingo18勾选global solver求解使用的算法
    • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
    • ¥20 测距传感器数据手册i2c