php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59660 IMagick::writeImage() failes with 'WriteBlob Failed'
Submitted: 2011-03-10 06:48 UTC Modified: 2011-03-10 08:26 UTC
From: simon dot sattes at googlemail dot com Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.3.3 OS: Linux Debian Squeeze 64bit AMD
Private report: No CVE-ID: None
 [2011-03-10 06:48 UTC] simon dot sattes at googlemail dot com
Description:
------------
I'm using a PHP script to convert an image (png in my testcase) into a 32-bit png and write it to disk again (I stripped out all transformations and security checks), see code below. When called with "/thumbnail.php?file=/path/to/image.png" I get an error when trying to write the file to disk with IMagick::writeImage(). When I echo the image with IMagick::getImageBlob() I get the expected result. The target directory is chmod'd to 777 to ensure there are no write restrictions.

Reproduce code:
---------------
<?php

$thumb = new Imagick($_GET['file']);
$thumb->setImageFormat('PNG32');

// dir '/srv/temp/thumbnails is 777 and owner:group is www-data:www-data (the apache user)
$thumb->writeImage('/srv/temp/thumbnails/test.png');


Expected result:
----------------
I expect the extension to write the image to disk.

Actual result:
--------------
This error message is thrown:

Fatal error: Uncaught exception 'ImagickException' with message 'WriteBlob Failed `/srv/temp/thumbnails/test.png' @ error/png.c/PNGErrorHandler/1455' in /srv/htdocs/thumbnail.php:7 Stack trace: #0 /srv/htdocs/thumbnail.php(7): Imagick->writeimage('/srv/temp/thumb...') #1 {main} thrown in /srv/htdocs/thumbnail.php on line 7 

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-10 08:26 UTC] simon dot sattes at googlemail dot com
After some research I found out the partition where the thumbnail should have been written to is full, so this isn't an ImageMagick bug. But maybe this could be treated as feature request to issue a "disk full" warning instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 09:01:28 2024 UTC