php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40976 Timeout at imagecreatetruecolor / imagecreate works
Submitted: 2007-04-02 13:30 UTC Modified: 2007-04-02 14:32 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: com at macx dot de Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: com at macx dot de
New email:
PHP Version: OS:

 

 [2007-04-02 13:30 UTC] com at macx dot de
Description:
------------
After upgrade to 5.2.1 I get the following error using "imagecreatetruecolor". This error don't appear using "imagecreate".

Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 3200 bytes) in [...] on line [...]

Line marked: imagefill (see code below)

Reproduce code:
---------------
$image = imagecreatetruecolor($image_width, $image_height);
$bg    = imagecolorallocate($image, 51, 51, 51);
imagefill($image, 0, 0, $bg);

Expected result:
----------------
Filled rectangle.

Actual result:
--------------
see description

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-02 13:37 UTC] pajoye@php.net
"Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to
allocate 3200 bytes)"

You reached the memory limit.

I do not know how large are the width and the height but it is not a bug. Increase your memory limit if you work with large images.

Not a bug > bogus.


 [2007-04-02 13:56 UTC] com at macx dot de
I think 30 MB is enough. With php 5.0.5 this works very fine.

$image_width  = 800;
$image_height = 470;

This is not mutch.
 [2007-04-02 14:03 UTC] pajoye@php.net
"I think 30 MB is enough. With php 5.0.5 this works very fine."

The default php 5.2 memory limit (it is on by default now!) is 128M, it  is more than before and the reasons why this limit is higher is well explained in the update notes. Please read them.

"
$image_width  = 800;
$image_height = 470;

This is not mutch."

Do you have only this two lines in your script?
 [2007-04-02 14:32 UTC] com at macx dot de
Thanks for your remarks.

I didn't use the recommend php.ini. Now with upgraded memory_limit of 128M it's working fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC