line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Image::Delivery::Provider::File; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
2820
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
149
|
|
4
|
4
|
|
|
4
|
|
19
|
use base 'Image::Delivery::Provider::Scalar'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1346
|
|
5
|
4
|
|
|
4
|
|
23
|
use File::Slurp (); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
71
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
17
|
use vars qw{$VERSION}; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
175
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
4
|
|
|
4
|
|
2441
|
$VERSION = '0.14'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
##################################################################### |
17
|
|
|
|
|
|
|
# Constructor |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
10
|
|
|
10
|
0
|
16730
|
my $class = shift; |
21
|
10
|
50
|
33
|
|
|
372
|
my $file = (defined $_[0] and -f $_[0] and -r _) ? shift : return undef; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Slurp in the image |
24
|
10
|
|
|
|
|
50
|
my $image = File::Slurp::read_file( $file, scalar_ref => 1 ); |
25
|
10
|
50
|
|
|
|
1568
|
return undef unless ref $image eq 'SCALAR'; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Hand off to our parent |
28
|
10
|
|
|
|
|
91
|
$class->SUPER::new( $image, @_ ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |