Subject: | addImgScaled() method ignores $scale parameter |
The addImgScaled() method disregards the scaling parameter and
just passes its args to the regular addImg() method.
This bug was originally reported against the Debian package by David
Pottage; cf. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365471
Find attached a patch by David that fixes this problem.
Please consider incorporating the patch in future releases.
Kind regards,
Gregor Herrmann (Debian Perl Group)
Subject: | PATCH_Report.pm |
--- Report.pm 2006-03-18 18:52:27.000000000 +0000
+++ FIXED_Report.pm 2006-04-30 11:17:00.000000000 +0100
@@ -580,6 +580,18 @@
sub addImg {
my ( $self, $file, $x, $y ) = @_;
+ $self->addImgScaled($file, $x, $y, 1);
+}
+
+=item $pdf->addImgScaled($file, $x, $y, $scale);
+
+Add image $file to the current page at position ($x, $y) scaled to $scale.
+
+=cut
+
+sub addImgScaled {
+ my ( $self, $file, $x, $y, $scale ) = @_;
+
my %type = (jpeg => "jpeg",
jpg => "jpeg",
tif => "tiff",
@@ -596,24 +608,7 @@
my $img = $self->{pdf}->$sub($file);
my $gfx = $self->{page}->gfx;
- $gfx->image($img, $x, $y);
-}
-
-=item $pdf->addImgScaled($file, $x, $y, $scale);
-
-Add image $file to the current page at position ($x, $y) scaled to $scale.
-
-=cut
-
-sub addImgScaled {
- my ( $self, $file, $x, $y, $scale ) = @_;
-
-# my $img = $self->{pdf}->image($file);
-# my $gfx = $self->{page}->gfx;
-
-# $gfx->image($img, $x, $y, $scale);
-
- $self->addImg($file, $x, $y);
+ $gfx->image($img, $x, $y, $scale);
}
=item $pdf->setGfxLineWidth($width);