当前位置: 首页 > 实例教程 > PHP imagick实例 > handle > imagick_image2blob()
<?php $handle = imagick_readimage( getcwd() . "/example/files/c/image.jpg" ) ; if ( imagick_iserror( $handle ) ) { $reason = imagick_failedreason( $handle ) ; $description = imagick_faileddescription( $handle ) ; print "handle failed!<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n" ; exit ; } if ( !( $image_data = imagick_image2blob( $handle ) ) ) { $reason = imagick_failedreason( $handle ) ; $description = imagick_faileddescription( $handle ) ; print "imagick_image2blob() failed<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n" ; exit ; } header( "Content-type: " . imagick_getmimetype( $handle ) ) ; print $image_data ; ?>