How do you get the com object to do anything other than just convert file formats?
I can get that to run just fine but if I try to resize an image it does nothing, no errors, it just creates the new file but with out resizing it.
$com_IM = new COM('ImageMagickObject.MagickImage.1');
$img = $com_IM->Convert($Logo,'-resize','80x60',$newImage);
$Logo is the original image and $newImage is the name of the new one.
Yes this is written in php but it says that you are supposed to be able to use it with the imagemagickobject and it works fine converting file formats.
Any ideas about what the correct syntax would be or why it would not also resize the image?
I'm not familiar with PHP, so I'm not going to be able to troubleshoot much. What happens when you pass in the additional parameters in as variables like the original and new file names? I wouldn't think that would make a difference, though....
Actually my real problem is that the code works but only some of the time, and I cannot figure out what triggers it to work and what triggers it to not work. It does not seem to be file format or image size, just that one time it will, and the next time it will not, or I wait an hour or so and try one that did not work before and it seems to work resizing it just fine.
I cannot pass in the first file name in as a string but for some reason it only takes a variable. That is fine with me since the application that I need it for requires that anyway. It never seemed to work right when I passed in the additional parameters as variables.
Are you cleaning up your object properly? If not, that might be causing some memory problems?
Another option, although probably not preferred is to call out tom the command line instead of using the object. The command line is solid, although the object has worked pretty reliably for me for a while now.
unfortunately going just from the command line is not an option since this is for a site and to run the exec on the command line requires too much of a loosening on permissions. I will double check to make sure that I am closing everything off correctly on the object.