Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 18561
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: Nobody in particular
Requestors: avi [...] finkel.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.50
Fixed in: (no value)



Subject: Imager fails compile due to unloaded module "Imager::Color::Float"
The attached file demonstrates the problem. When calling "setpixel" (and probably other similar methods) on an Imager object, with a color value as an arrayref, with all 0 values for the color, the Imager code attempts to create the color object as an instance of Imager::Color::Float. However, this file is not loaded by any modules loaded by simplying using Imager, so the compile fails with this error: Can't locate object method "new" via package "Imager::Color::Float" at /usr/lib/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Imager.pm line 535. The user-space fix for this is to always say "use Imager::Color::Float" after "use Imager". The distribution-level fix for this is probably to put "use Imager::Color::Float" in Imager.pm. Or, to fix the code in _color() surrounding the line in question, because that stuff all looks a little bit shady to me.
Subject: imager.pl
#!/usr/bin/perl use Imager; # use Imager::Color::Float; my $i = Imager->new( xsize => 50, ysize => 50, ); $i->setpixel( x => 10, y => 10, color => [0, 0, 0], );
Thanks for reporting this. Looking at this I can see a few different issues it can cause, since most of the low level code expected Imager::Color objects not Imager::Color::Float. For 0.51 I'll remove that branch and add some regression tests.