aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Utils/Photo.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-01-15 14:56:00 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-01-15 14:56:00 +0000
commit3d5e0210feacf96e21e1916ab0df84b83f5f05e2 (patch)
treec9f82ab699f4f4b589345a55a70880ebf5089c90 /perllib/Utils/Photo.pm
parent0e257b2201998d428b3624a15dfeeb03a5559371 (diff)
parentb8685054be0e16bc836dc568c0687a6f86400f38 (diff)
Merge branch '1300-multiple-update-photos'
Diffstat (limited to 'perllib/Utils/Photo.pm')
-rw-r--r--perllib/Utils/Photo.pm41
1 files changed, 0 insertions, 41 deletions
diff --git a/perllib/Utils/Photo.pm b/perllib/Utils/Photo.pm
deleted file mode 100644
index a1af90fe1..000000000
--- a/perllib/Utils/Photo.pm
+++ /dev/null
@@ -1,41 +0,0 @@
-package Utils::Photo;
-
-use Image::Size;
-
-=head2 get_photo_params
-
-Returns a hashref of details of any attached photo for use in templates.
-Hashref contains height, width and url keys.
-
-=cut
-
-sub get_photo_params {
- my ($self, $key) = @_;
-
- return {} unless $self->photo;
-
- $key = ($key eq 'id') ? '' : "/$key";
-
- my $pre = "/photo$key/" . $self->id;
- my $post = '.jpeg';
- my $photo = {};
-
- if (length($self->photo) == 40) {
- $post .= '?' . $self->photo;
- $photo->{url_full} = "$pre.full$post";
- # XXX Can't use size here because {url} (currently 250px height) may be
- # being used, but at this point it doesn't yet exist to find the width
- # $str = FixMyStreet->config('UPLOAD_DIR') . $self->photo . '.jpeg';
- } else {
- my $str = \$self->photo;
- ( $photo->{width}, $photo->{height} ) = Image::Size::imgsize( $str );
- }
-
- $photo->{url} = "$pre$post";
- $photo->{url_tn} = "$pre.tn$post";
- $photo->{url_fp} = "$pre.fp$post";
-
- return $photo;
-}
-
-1;