好的,我有这个代码
<?php
/* Create the object */
$image = new Imagick('http://mysite.org.uk/login/tiftest/1.tif');
$count = $image->getNumberImages();
##echo "<h3 style=\"font: bold 12pt Arial\">Total Number of Images Extracted ".
## "from the TIF : ".$image->getNumberImages()."</h3>";
$x =0;
foreach ( $image as $image ) {
$x++;
$image->setImageFormat( 'png' );
$image->thumbnailImage(150, 120);
echo "<img id='" . $x . "' src='data:image/png;base64,".base64_encode($image)."' />";
}
?>
这确实有效并且图像显示正确,但我不得不使用 base64_encode 对图像进行编码,并将图像编码为:
<img id="1" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAC0CAQAAAD1RyCWAAAAAmJLR0QA/4ePzL8A==">
我怎样才能解决这个问题,所以它只显示为
<img id='1' src=' ** something normal like image file name **' />
谁能指出我正确的方向