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.