preparation for separate distribution.
https://rt.cpan.org/Ticket/Display.html?id=49616 (partial)
+ - optimize filled box drawing (color, not fill)
+
Bug fixes:
- Imager::Probe was calling ExtUtils::Liblist to initialize
then only when it would use its search mechanisms.
https://rt.cpan.org/Ticket/Display.html?id=60509
+ - fix the cache check for the X rgb.txt loader. This is typically
+ used for color translation on Unix-like systems, and improves
+ performance of supplying colors by name by about 80 times. Test
+ code that managed 3400 10x10 pixel boxes/second sped up to 25700
+ boxes/second.
Imager 0.77 - 11 Aug 2010
===========
'/usr/share/gimp/palettes/Named_Colors',
);
+my $default_gimp_palette;
+
sub _load_gimp_palette {
my ($filename) = @_;
if ($args{palette}) {
$filename = $args{palette};
}
+ elsif (defined $default_gimp_palette) {
+ # don't search again and again and again ...
+ if (!length $default_gimp_palette
+ || !-f $default_gimp_palette) {
+ $Imager::ERRSTR = "No GIMP palette found";
+ $default_gimp_palette = "";
+ return;
+ }
+
+ $filename = $default_gimp_palette;
+ }
else {
# try to make one up - this is intended to die if tainting is
# enabled and $ENV{HOME} is tainted. To avoid that untaint $ENV{HOME}
}
if (!$filename) {
$Imager::ERRSTR = "No GIMP palette found";
+ $default_gimp_palette = "";
return ();
}
+
+ $default_gimp_palette = $filename;
}
if ((!$gimp_cache{$filename}
'/usr/openwin/lib/X11/rgb.txt',
);
+my $default_x_rgb;
+
# called by the test code to check if we can test this stuff
sub _test_x_palettes {
@x_search;
if ($args{palette}) {
$filename = $args{palette};
}
+ elsif (defined $default_x_rgb) {
+ unless (length $default_x_rgb) {
+ $Imager::ERRSTR = "No X rgb.txt palette found";
+ return ();
+ }
+ $filename = $default_x_rgb;
+ }
else {
for my $attempt (@x_search) {
if (-e $attempt) {
}
if (!$filename) {
$Imager::ERRSTR = "No X rgb.txt palette found";
+ $default_x_rgb = "";
return ();
}
}
if ((!$x_cache{$filename}
- || (stat $filename)[9] != $x_cache{$filename})
+ || (stat $filename)[9] != $x_cache{$filename}{mod_time})
&& !_load_x_rgb($filename)) {
return ();
}
+ $default_x_rgb = $filename;
+
if (!$x_cache{$filename}{colors}{lc $args{name}}) {
$Imager::ERRSTR = "Color '$args{name}' isn't in $filename";
return ();