Bug#365471: libpdf-report-perl: addImgScaled() method disregards
the scaling parameter does a simple addImg()
David Pottage
david at chrestomanci.org
Sun Apr 30 10:25:36 UTC 2006
Package: libpdf-report-perl
Version: 1.30-4
Severity: normal
Tags: patch
In PDF::Report, the addImgScaled() method disregards the scaling parameter and just passes it's args to the regular addImg() method. It is simple to
fix as the underlying PDF::API2 libary provides an option to add scaled images. I have included a patch below:
--- 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);
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (900, 'testing'), (400, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages libpdf-report-perl depends on:
ii libpdf-api2-perl 0.51-1 provides the functions for creatin
ii libtext-roman-perl 3.3-3 A module for managing integer and
ii perl 5.8.8-4 Larry Wall's Practical Extraction
libpdf-report-perl recommends no packages.
-- no debconf information
-------------- next part --------------
--- 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);
More information about the pkg-perl-maintainers
mailing list