1 | # +-----------------------------------------------------------------------+ |
---|
2 | # | pLoader - a Perl photo uploader for Piwigo | |
---|
3 | # +-----------------------------------------------------------------------+ |
---|
4 | # | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | |
---|
5 | # +-----------------------------------------------------------------------+ |
---|
6 | # | This program is free software; you can redistribute it and/or modify | |
---|
7 | # | it under the terms of the GNU General Public License as published by | |
---|
8 | # | the Free Software Foundation | |
---|
9 | # | | |
---|
10 | # | This program is distributed in the hope that it will be useful, but | |
---|
11 | # | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
12 | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
13 | # | General Public License for more details. | |
---|
14 | # | | |
---|
15 | # | You should have received a copy of the GNU General Public License | |
---|
16 | # | along with this program; if not, write to the Free Software | |
---|
17 | # | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
18 | # | USA. | |
---|
19 | # +-----------------------------------------------------------------------+ |
---|
20 | package Uploader::Image; |
---|
21 | use strict; |
---|
22 | use base qw/Uploader::Object/; |
---|
23 | |
---|
24 | __PACKAGE__->mk_accessors( |
---|
25 | qw/ |
---|
26 | file |
---|
27 | wx_thumb_file |
---|
28 | site_high_file |
---|
29 | site_name |
---|
30 | site_resized_file |
---|
31 | site_thumb_file |
---|
32 | site_author |
---|
33 | site_comment |
---|
34 | site_original_filename |
---|
35 | exif_metadata |
---|
36 | add_rank |
---|
37 | site_categories |
---|
38 | site_tags |
---|
39 | file_sum |
---|
40 | width |
---|
41 | height |
---|
42 | privacy_level |
---|
43 | / |
---|
44 | ); |
---|
45 | |
---|
46 | sub Init { |
---|
47 | my ( $self ) = @_; |
---|
48 | |
---|
49 | } |
---|
50 | |
---|
51 | sub exif_tag { |
---|
52 | my ( $self, $tag ) = @_; |
---|
53 | |
---|
54 | my $exif = $self->exif_metadata ; |
---|
55 | |
---|
56 | $exif->{$tag}; |
---|
57 | } |
---|
58 | |
---|
59 | sub create_date { |
---|
60 | my ( $self, $date ) = @_; |
---|
61 | |
---|
62 | my $exif = $self->exif_metadata ; |
---|
63 | |
---|
64 | $self->{-create_date} ||= $exif->{CreateDate}; |
---|
65 | |
---|
66 | $self->{-create_date} = $date if defined $date; |
---|
67 | |
---|
68 | $self->{-create_date}; |
---|
69 | } |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | 1; |
---|