Return Values

Errors/Exceptions

User Contributed Notes 3 notes

If you are using windows imagemagick, at leat in my case, you have to include the full path of the file, including the 'c:' at the beginning. If you don't know for sure the way that the filename is going to come, you can use realpath() function to normalize it:

<?php $incoming_file = '/Users/John/Desktop/file_loco.jpg';$img = new Imagick(realpath($incoming_file));// realpath() will convert '/Users/John/Desktop/file_loco.jpg' to 'C:\Users\John\Desktop\file_loco.jpg' // and ImageMagick will have no trouble when loading?>

If you try and load an ICO file whose extension isn't .ico, you'll get an error going along the lines of no delegate existing for the supplied image's format. The can occur, for example, if you're using a temporary file.