PHP/Imagick: Image only written if echo'd

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Jesdisciple
Posts: 10
Joined: 2011-03-11T14:26:57-07:00
Authentication code: 8675308

PHP/Imagick: Image only written if echo'd

Post by Jesdisciple »

The following PHP, when passed this image, writes 0 bytes to $cache (but works fine with all other known images). If the echo just before the call to writeImage is uncommented, it works fine. (The PHP is being run via <?php exec('php -f thumb.php -- img=zc9vfo.png >output'); ?> for unrelated reasons.) If anyone can give me a hint for what to look into, that would be fantastic.

EDIT: The script is actually segfaulting whether the image data is written (because of getImageBlob) or not. Here's a minimal test case, to be run via php -f thumb.php with the image in question saved in the same directory as original.png:

Code: Select all

<?php

$thumb = new Imagick('original.png');
$thumb->setImageFormat('png');
//echo $thumb->getImageBlob();
$thumb->writeImage('duplicate.png');

?>
Last edited by Jesdisciple on 2011-03-18T16:44:54-07:00, edited 3 times in total.
Jesdisciple
Posts: 10
Joined: 2011-03-11T14:26:57-07:00
Authentication code: 8675308

Re: PHP/Imagick: Image only written if echo'd

Post by Jesdisciple »

(bump)
Post Reply