php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10097 ImageColorAllocate() doesn't work with ImageCreateFromJPEG()
Submitted: 2001-04-01 08:04 UTC Modified: 2001-04-01 13:40 UTC
From: vha at oct31 dot de Assigned:
Status: Closed Package: *Graphics related
PHP Version: 4.0.4pl1 OS: Linux
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: vha at oct31 dot de
New email:
PHP Version: OS:

 

 [2001-04-01 08:04 UTC] vha at oct31 dot de
After creating an image with ImageCreateFromJPEG() all ImageAllocate() on this image fail.
The same script with ImageCreate() works fine.

http://oct31.de/dyn/clock.php?img=avface2bl
http://oct31.de/dyn/clock.php

Config see http://oct31.de/php/phpinfo.php

I don't run the server myself and cannot tell much about the configuration.

Script source at http://oct31.de/aw/phpclock/index.html

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-01 13:04 UTC] sniper@php.net
Please explain HOW it doesn't work? 
The URLs seem to work just fine.

And you shouln't be reporting the bug if you're not
admin of the site as you can't try any other versions
of PHP or GD.

And FYI: ImageColorAllocate() after imagecreatefromjpeg()
works just fine for me.


--Jani

 [2001-04-01 13:15 UTC] vha at oct31 dot de
After creating an image with ImageCreateFromJPEG() all ImageAllocate() on this image fail.
The same script with ImageCreate() works fine.

http://oct31.de/dyn/clock.php?img=avface2bl
http://oct31.de/dyn/clock.php

Config see http://oct31.de/php/phpinfo.php

I don't run the server myself and cannot tell much about the configuration.

Script source at http://oct31.de/aw/phpclock/index.html

==== modification ====

It seems to be an undocumented limitation, not a bug.

After trying ImageColorAllocate() on an image created from a JPG with only very few colors, the colors could be allocated
 [2001-04-01 13:19 UTC] sniper@php.net
Could you please clarify this a little bit ie.
add the examples of both cases (one color allocation that doesn't work and the one that works)

--Jani

 [2001-04-01 13:28 UTC] vha at oct31 dot de
explanation :

The clocks hands SHOULD be in 2 different red variants if no different color is specified - it works in a low-color JPG :

http://oct31.de/dyn/clock.php
- no texture, image created with ImageCreate()
- the clock hands show in red

http://oct31.de/dyn/clock.php?img=ffffff&hs=30
- ffffff.jpg is a plain white JPG
- the clock hands show in red

The same on a JPG with more colors :
http://oct31.de/dyn/clock.php?img=av_face1&hs=30
- av_face1 uses 2686 different colors
- the clock hands show in a color that is used somewhere in the source JPG
 [2001-04-01 13:40 UTC] sniper@php.net
This is limitation of GD library. It only supports 256 colors. Not a bug in PHP.

--Jani

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Nov 15 03:01:25 2018 UTC