blib/lib/URI/Title/Image.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 30 SCAR 17.9
CC
2
Cov
0%
title
6.0
types
2.0
BEGIN
2.0
CRAP 6.0
1 package URI::Title::Image;
2 $URI::Title::Image::VERSION = '1.902';
3 use warnings;
4 use strict;
5  
6 use Image::Size;
7  
8 sub types {(
9 'image/gif',
10 'image/jpg',
11 'image/jpeg',
12 'image/png',
13 'image/x-png',
14 )}
15  
16 sub title {
17 my ($class, $url, $data, $type) = @_;
18 my $name = ( split m{/}, $url )[-1];
19  
20 my ($x, $y) = imgsize(\$data);
21 $type =~ s!^[^/]*/!!;
22 $type =~ s!^x-!!;
23 return $x && $y
24 ? "$name ($type ${x}x${y})"
25 : "$name ($type)";
26 }
27  
28 1;
29  
30 __END__