Skip Menu |
 

This queue is for tickets about the GD CPAN distribution.

Report information
The Basics
Id: 40525
Status: new
Priority: 0/
Queue: GD

People
Owner: Nobody in particular
Requestors: BRUNORC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 2.39
  • 2.41
Fixed in: (no value)



Subject: "transparent" somehow alters color table
Download (untitled) / with headers
text/plain 348b
There is somehow strange behavior while applying transparency to images loaded from JPG/GIF files. To summarize: my $closest = $img->colorClosest( $r, $g, $b ); $img->transparent( $img->colorClosest( $r, $g, $b ) ); # Now $img->transparent == $closest # but $img->transparent != $img->colorClosest( $r, $g, $b ) I'm attaching the failing test.
Subject: transp.t
Download transp.t
text/x-perl 1.2k
use strict; use warnings; use Test::More tests => 10; use_ok('GD'); my $im = GD::Image->newFromGif("class.gif"); $im->transparent( -1 ); is($im->transparent, -1, 'image is not transparent'); my $closest = $im->colorClosest( 24, 53, 62 ); $im->transparent( $im->colorClosest( 24, 53, 62 ) ); ok( $im->transparent == $closest, 'transparency preserves RGB before' ); ok( $im->transparent == $im->colorClosest( 24, 53, 62 ), 'transparency preserves RGB after' ); $im = GD::Image->newFromJpeg("class.jpg"); $im->transparent( -1 ); is($im->transparent, -1, 'image is not transparent'); $closest = $im->colorClosest( 24, 53, 62 ); $im->transparent( $im->colorClosest( 24, 53, 62 ) ); ok( $im->transparent == $closest, 'transparency preserves RGB before' ); ok( $im->transparent == $im->colorClosest( 24, 53, 62 ), 'transparency preserves RGB after' ); $im = GD::Image->newFromJpeg("dupa.jpg"); $im->transparent( -1 ); is($im->transparent, -1, 'image is not transparent'); $closest = $im->colorClosest( 24, 53, 62 ); $im->transparent( $im->colorClosest( 24, 53, 62 ) ); ok( $im->transparent == $closest, 'transparency preserves RGB before' ); ok( $im->transparent == $im->colorClosest( 24, 53, 62 ), 'transparency preserves RGB after' );


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.