php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8664 Impossible to use ImageColorTransparent under certain conditions
Submitted: 2001-01-11 17:10 UTC Modified: 2001-07-21 20:45 UTC
From: reinke at e-softinc dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4.0.1pl2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: reinke at e-softinc dot com
New email:
PHP Version: OS:

 

 [2001-01-11 17:10 UTC] reinke at e-softinc dot com
By limiting the use of ImageColorTransparent to working on colors
returned by ImageColorAllocate, the library prevents one from
modifying pre-existing images.  For example, suppose an existing
image has a transparent color set. Now, we load the image using
ImageCreateFromGIF. We proceed to add a text blurb, and then
issue ImageGif.  The transparency is removed, and there is no
way to set it, because there is no way to map an existing color
index in the palette to an ImageColor object(?) so that it can
be passed in to ImageColorTransparent.

Ideally, ImageColorTransparent should have been made to
work with color indexes the way the native gd routines work.
But, to avoid breaking code, I'd recommend adding a new method
called ImageColorTransparentByIndex which accepted a color
index as the second parameter instead of a color object returned
by ImageColorAllocate.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-21 20:45 UTC] andy@php.net
Try using ImageColorExact or ImageColorClosest

The manual pages are below

http://php.net/manual/en/function.imagecolorexact.php
http://php.net/manual/en/function.imagecolorclosest.php

 [2001-07-21 20:45 UTC] andy@php.net
Try using ImageColorExact or ImageColorClosest

The manual pages are below

http://php.net/manual/en/function.imagecolorexact.php
http://php.net/manual/en/function.imagecolorclosest.php

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC