Issue
I have this code:
$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;
My question is: How do I loop this result? Any time I loop, I get header issue.
Solution
I was able to solve it. I used this method: In my loop, I called thumbnail.php as image source
<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>
Then on thumbnail.php I call my header and imagick, this way:
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;
Worked the way I like it!
Answered By - Sam Adah Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.