line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Posterous::Media::Image; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
6
|
use base qw(Net::Posterous::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
329
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Net::Posterous::Media::Image - represent an image object in Net::Posterous |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 METHODS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head2 url |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Get or set the url for this image. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
sub url { |
21
|
0
|
|
|
0
|
1
|
|
shift->_do('medium','url', @_); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 filesize |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Get or set the filesize for this image. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
sub filesize { |
30
|
0
|
|
|
0
|
1
|
|
shift->_do('medium','filesize', @_); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 width |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Get or set the width for this image. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
sub width { |
39
|
0
|
|
|
0
|
1
|
|
shift->_do('medium','width', @_); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 height |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Get or set the height for this image. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
sub height { |
48
|
0
|
|
|
0
|
1
|
|
shift->_do('medium','height', @_); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 thumb_url |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Get or set the URL to thumbnail for this image. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
sub thumb_url { |
57
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
shift->_do('thumb','url', @_); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 thumb_width |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Get or set the width of the thumbnail for this image. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
sub thumb_width { |
67
|
0
|
|
|
0
|
1
|
|
shift->_do('thumb','width', @_); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 thumb_height |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Get or set the height of the thumbnail for this image. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
sub thumb_height { |
76
|
0
|
|
|
0
|
1
|
|
shift->_do('thumb','height', @_); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# we do this to normalise the methods for this object. |
80
|
|
|
|
|
|
|
# Because the Posterous returned object is ... inconsistent |
81
|
|
|
|
|
|
|
sub _do { |
82
|
0
|
|
|
0
|
|
|
my $self = shift; |
83
|
0
|
|
|
|
|
|
my $part = shift; |
84
|
0
|
|
|
|
|
|
my $key = shift; |
85
|
0
|
0
|
|
|
|
|
$self->{$part}->{$key} = shift if @_; |
86
|
0
|
|
|
|
|
|
return $self->{$part}->{$key}; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
1; |