php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50610 imagerotate transparent gif some angles invert new background
Submitted: 2009-12-30 05:59 UTC Modified: 2016-07-24 04:22 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ceo at l-i-e dot com Assigned: pajoye (profile)
Status: No Feedback Package: GD related
PHP Version: 5.*, 6 OS: *
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ceo at l-i-e dot com
New email:
PHP Version: OS:

 

 [2009-12-30 05:59 UTC] ceo at l-i-e dot com
Description:
------------
imagerotate for a transparent input GIF, trying to output a transparent output GIF.

At various angles it will fill the new / expanded background with the wrong (non-transparent black) color.

This may be the same as http://bugs.php.net/bug.php?id=44429 but I can't tell without the other guy's image either...

It could also be related to http://bugs.php.net/bug.php?id=39366 somehow, but that pre-dates this quite a bit, and is supposedly fixed in CVS (now SVN).  Plus that's PNG not GIF, though there may be shared code at work.

I do have a nice repro for you below.

NOTE:
This happened to me in PHP 5.2.5, and it's conceivable that it has been fixed, but it has also been confirmed in 5.2.6 by Jochem Maas:
[quote]
I tested on  PHP5.2.6, with the following GD installed:

GD Version                 bundled (2.0.34 compatible)
FreeType Support         enabled
FreeType Linkage         with freetype
FreeType Version         2.3.7
GIF Read Support         enabled
GIF Create Support         enabled
JPG Support                 enabled
PNG Support                 enabled
WBMP Support                 enabled
XPM Support                 enabled
XBM Support                 enabled

I get the same result as you. I played with it a bit and the issue 'seems' to revolve
around transparency in the original gif. I got the following code to output what you
want but I have no idea if it's usable for you (you may be relying on the
transparency in
the original gif):


Reproduce code:
---------------
http://www.6112northwolcott.com/dogfight/rotate.phps

Expected result:
----------------
All the images in the actual result should have white / transparent backgrounds, unless I'm being particularly dense today.


Actual result:
--------------
http://www.6112northwolcott.com/dogfight/rotate.htm


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-30 17:12 UTC] ceo at l-i-e dot com
I have confirmed this bug remains in 5.3.2-dev on a localhost box.
 [2009-12-30 23:51 UTC] jani@php.net
How about bug #41624 ?
 [2009-12-31 00:52 UTC] ceo at l-i-e dot com
Adding imagesavealpha($rotated, 1); at line 7, immediately after imagerotate but before imagegif does not have any visible effect.

I.e., it's still broken.
 [2009-12-31 18:00 UTC] jani@php.net
So it seems.
 [2011-05-04 20:26 UTC] contact at rnmail dot de
Fix in sight?
 [2016-07-15 18:17 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2016-07-15 18:17 UTC] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

The links to the reproduce code don't work anymore.
 [2016-07-24 04:22 UTC] php-bugs 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 "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC