Skip Menu |

This queue is for tickets about the Image-Info CPAN distribution.

Report information
The Basics
Id: 118495
Status: resolved
Priority: 0/
Queue: Image-Info

People
Owner: Nobody in particular
Requestors: jv [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.39
Fixed in: 1.39_50



Subject: Warnings while processing PNGs
In Image/Info/PNG.pm, around line 61: $last =~ s/\s(\d+)$//; my $count = $1 || 1; if ($last eq $type) { $count++; When the replace fails, garbage from an earlier match is put in $count, which can generate warnings on the increment when it is not a number. In a particular situation, I got warnings like: Argument ".png" treated as 0 in increment (++) at /home/jv/lib/perl5/Image/Info/PNG.pm line 64. Trivial fix is appended.
Subject: Image_Info_PNG.patch
*** /usr/share/perl5/vendor_perl/Image/Info/PNG.pm 2014-12-19 22:56:15.000000000 +0100 --- lib/Image/Info/PNG.pm 2016-10-24 08:15:45.955054105 +0200 *************** *** 58,65 **** if (@chunks) { my $last = $chunks[-1]; ! $last =~ s/\s(\d+)$//; ! my $count = $1 || 1; if ($last eq $type) { $count++; $chunks[-1] = "$type $count"; --- 58,65 ---- if (@chunks) { my $last = $chunks[-1]; ! my $count = 1; ! $count = $1 if $last =~ s/\s(\d+)$//; if ($last eq $type) { $count++; $chunks[-1] = "$type $count";
On 2016-10-24 18:02:10, JV wrote: Show quoted text
> In Image/Info/PNG.pm, around line 61: > > $last =~ s/\s(\d+)$//; > my $count = $1 || 1; > if ($last eq $type) { > $count++; > > When the replace fails, garbage from an earlier match is put in > $count, which can generate warnings on the increment when it is not a > number. > > In a particular situation, I got warnings like: > > Argument ".png" treated as 0 in increment (++) at > /home/jv/lib/perl5/Image/Info/PNG.pm line 64. > > Trivial fix is appended.
Thanks, applied as commit 27f0d2cba1ed6888e08d90da6c7331deff60468a in the git repository.