我有以下代码:
$im = new imagick($folder) . '[0]'); // convert to JPEG $im->setImageFormat('jpg'); $im->resizeImage(290, 375, imagick::FILTER_LANCZOS, 1); $im->setResolution( 700, 700 ); header('Content-Type: image/jpeg'); echo $im;
我的问题是:如何循环这个结果?每当我循环时,我都会遇到标题问题。
我能够解决它。我使用了这个方法:在我的循环中,我调用了缩略图。php作为图像源
<li><a href='download.php?pathname=$file'><img src='thumbnail.php?pathname=$file' style='float:left; margin-top:-10px; text-align:center; width:111px;' /></li>
然后在缩略图上。php我调用header和imagick,方法如下:
header('Content-Type: image/jpeg'); $im = new imagick($_GET['pathname']. '[0]'); // convert to JPEG $im->setImageFormat('jpg'); $im->resizeImage(290, 375, imagick::FILTER_LANCZOS, 1); $im->setResolution( 700, 700 ); echo $im;
按我喜欢的方式工作!