php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30508 imagecreate has bad output
Submitted: 2004-10-21 05:15 UTC Modified: 2004-11-10 02:19 UTC
From: jsgoupil at lookstrike dot com Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 5.0.2 OS: WinXP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jsgoupil at lookstrike dot com
New email:
PHP Version: OS:

 

 [2004-10-21 05:15 UTC] jsgoupil at lookstrike dot com
Description:
------------
I'm currently developing a program that involves a lot of classes. When I have to draw one on an image with GD, a method one call a parent class method, and this parent another parent and on and on... 

If I put to many "links" of a class in another, the GD image will lose some rectangles, lines, text strings... and other rectangles appear black filled. 

When I change imagecreate() by imagecreatetruecolor(), it's working fine.

I'm currently using WinXP with Apache2, PHP5.0.2 (php-cgi.exe) with the GD2 library php_gd2.dll (provided by PHP).
I was wondering if it was a problem with memory... in php.ini, I've set the maximum memory to more than 8M but it didn't work anymore.

Reproduce code:
---------------
I really tried to do a little code to reproduce the error but I've spent about 2 hours in vain...
My code is not free and I don't want to post it here. To whom may I send it (email... ?)?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-09 18:35 UTC] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2004-11-09 20:29 UTC] pajoye@php.net
You reached the maximum amount of colors you can have. Using a truecolor you do not have real limits. Read the manual for further informations.

--Pierre
 [2004-11-09 22:34 UTC] jsgoupil at lookstrike dot com
Only using black and white image.
I have the zip of the code. To who I have to send it ?
Contact me by email if you want.
 [2004-11-10 01:34 UTC] pajoye@php.net
> Only using black and white image.

You mean that:
- you allocate only 0 and 255,255,255? (that means no grayscale)

- you do not allocate again and again the same color
  in each function/class/whatever?

> I have the zip of the code. To who I have to send it ?

No need to see code, you clearly reached the limit of your current palette (max is 255 colors + bg), even if you are using 128 times white and 128 times black.

pass the index of the color as the argument and not the value of RGB.

Please keep it bogus, it's clearly a misusage.

--Pierre
 [2004-11-10 02:19 UTC] jsgoupil at lookstrike dot com
It's not written at all in the documentation... that we can use only 255 colors (even if we use the same color with multiple calls of imagecolorallocate). Or, why no warning when allocating ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 18:01:34 2024 UTC