php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59449 Uncaught exception 'ImagickException' with message 'memory allocation failed
Submitted: 2010-10-05 07:52 UTC Modified: 2013-02-18 00:35 UTC
Votes:8
Avg. Score:4.4 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:4 (57.1%)
From: samro dot subhro at gmail dot com Assigned:
Status: No Feedback Package: imagick (PECL)
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2010-10-05 07:52 UTC] samro dot subhro at gmail dot com
Description:
------------
Getting error Uncaught exception 'ImagickException' with message 'memory allocation failed while trying to write an image. Working fine with windows XAMPP server but getting error on Linux server

Reproduce code:
---------------
<?php
$thumb = new Imagick();
$thumb->readImage('1.jpg');
$thumb->writeImage('test.gif');
$thumb->clear();
$thumb->destroy();
?>



Expected result:
----------------
This should work fine

Actual result:
--------------
This is showing a FATAL error

Its showing 
Fatal error: Uncaught exception 'ImagickException' with message 'memory allocation failed `/home/p21628/domains/bannermaken.nl/public_html/magic/test.gif' @ error/gif.c/WriteGIFImage/1627' in /home/p21628/domains/bannermaken.nl/public_html/magic/index6.php:4 Stack trace: #0 /home/p21628/domains/bannermaken.nl/public_html/magic/index6.php(4): Imagick->writeimage('test.gif') #1 {main} thrown in /home/p21628/domains/bannermaken.nl/public_html/magic/index6.php on line 4

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-12 05:26 UTC] a dot catel at weelya dot com
Same here
 [2010-11-18 06:53 UTC] mkoppanen@php.net
Do you have memory available?
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2016-12-25 13:58 UTC] miqrogroove at gmail dot com
I'm experiencing same problem on BlueHost with a simple WordPress image upload.

ImagickException::__set_state(array(
   'message' => 'memory allocation failed `2016-10-19-02-15-300x225.gif\' @ error/gif.c/WriteGIFImage/1633',
   'string' => '',
   'code' => 400,
   'file' => '/wp-includes/class-wp-image-editor.php',
   'line' => 424,
   'trace' => 
  array (
    0 => 
    array (
      'function' => 'writeimage',
      'class' => 'Imagick',
      'type' => '->',
      'args' => 
      array (
        0 => '2016-10-19-02-15-300x225.gif',
      ),
    ),
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC