pingImage($image); /*** read the image into the object ***/ $im->readImage( $image ); /*** thumbnail the image ***/ $im->thumbnailImage( $width, $height ); /*** Write the thumbnail to disk ***/ $im->writeImage( 'THUMB_'.$file ); /*** Free resources associated with the Imagick object ***/ $im->destroy(); return 'THUMB_'.$file; } catch(Exception $e) { print $e->getMessage(); return $file; } }; ?>