Code: Select all
<html><body>
<?php
$path="/usr/local/convert -version";
exec($path,$convert_version,$convert_return);
print( "<br />\n" );
print( "path: $path<br />\n" );
print( "convert_return: $convert_return<br />\n" );
print( "convert_version:<br />\n" );
foreach( $convert_version as $key ) {
print( " $key: $convert_version[$key]<br />\n" );
}
?>
</body></html>
Clearly IM is being found and run correctly, but for some reason it returns a failure code (1) instead of success (0). For context, I'm using Omeka (http://omeka.org/) which is checking that IM exists before it tries to use it. Luckily for me, Omeka is open source, so I can modify the Omeka code to always 'return true' that IM is installed correctly. After that, IM and Omeka work perfectly together.path: /usr/local/convert -version
convert_return: 1
convert_version:
Version: ImageMagick 6.4.9-2 2009-03-03 Q16 OpenMP http://www.imagemagick.org:
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC:
I think someone has a problem here; is it the value IM is returning when checking the version, or is it the manner in which Omeka checks if IM exists? I would think IM should return 'success' when it successfully performs what the user asked of it (i.e. printing the version information), you tell me... For reference, Omeka simply compares the $convert_return value to 0 to determine success/failure/existence-of-IM.
If a call to version is supposed to return failure, can you point me to where this is stated? Some sort of convention guidelines or something? I originally posted this on the Omeka forums, so if you tell me this isn't a bug with IM, I'm gonna go back and tell the Omeka people; I'll need support to explain why version printing should return failure.