parameters.
http://rt.cpan.org/Ticket/Display.html?id=29937
+ - mixing qtype scaling now sets all channels of a pixel to zero if
+ the pixel has zero coverage (zero alpha). This should produce more
+ compressible output files.
+ http://rt.cpan.org/Ticket/Display.html?id=32324
+
Imager 0.62 - 10 December 2007
===========
xscale_row[x].channel[ch] = IM_LIMIT(val);
}
}
+ else {
+ /* rather than leaving any color data as whatever was
+ originally in the buffer, set it to black. This isn't
+ any more correct, but it gives us more compressible
+ image data.
+ RT #32324
+ */
+ for (ch = 0; ch < alpha_chan; ++ch) {
+ xscale_row[x].channel[ch] = 0;
+ }
+ }
xscale_row[x].channel[alpha_chan] = IM_LIMIT(accum_row[x].channel[alpha_chan]+0.5);
}
}
out[out_x].channel[ch] = IM_LIMIT(val);
}
}
+ else {
+ for (ch = 0; ch < alpha_chan; ++ch) {
+ /* See RT #32324 (and mention above) */
+ out[out_x].channel[ch] = 0;
+ }
+ }
out[out_x].channel[alpha_chan] = IM_LIMIT(IM_ROUND(accum[alpha_chan]));
}
else {
out[out_x].channel[ch] = IM_LIMIT(val);
}
}
+ else {
+ for (ch = 0; ch < alpha_chan; ++ch) {
+ /* See RT #32324 (and mention above) */
+ out[out_x].channel[ch] = 0;
+ }
+ }
out[out_x].channel[alpha_chan] = IM_LIMIT(IM_ROUND(accum[alpha_chan]));
}
else {
#!perl -w
use strict;
-use Test::More tests => 227;
+use Test::More tests => 228;
BEGIN { use_ok(Imager=>':all') }
-use Imager::Test qw(is_image);
+use Imager::Test qw(is_image is_color4);
#require "t/testtools.pl";
my $cmp = $out->copy;
$out->rubthrough(src => $sc);
is_image($out, $cmp, "check we get the right image after scaling");
+
+ # we now set alpha=0 pixels to zero on scaling
+ is_color4($sc->getpixel('x' => 39, 'y' => 39), 0, 0, 0, 0,
+ "check we set alpha=0 pixels to zero on scaling");
}
{ # scale_calculate