diff options
author | Chris Mytton <self@hecticjeff.net> | 2013-09-12 11:22:10 +0100 |
---|---|---|
committer | Chris Mytton <self@hecticjeff.net> | 2013-09-12 11:22:10 +0100 |
commit | 18ade89f8f1303b184e55630421cd6f9f3e7d17b (patch) | |
tree | b4650070c07e9a669475724168b942b4bf6bd885 | |
parent | be464135d3021851d076a92a5bffa579064d9a68 (diff) |
Add fullsize photo to Photo controller
This is used in the Zurich admin to view a full size version of the
image before it has been made public.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Photo.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm index 8b00d1533..09afabecf 100644 --- a/perllib/FixMyStreet/App/Controller/Photo.pm +++ b/perllib/FixMyStreet/App/Controller/Photo.pm @@ -30,17 +30,19 @@ Display a photo =cut -sub during :LocalRegex('^([0-9a-f]{40})\.temp\.jpeg$') { +sub during :LocalRegex('^([0-9a-f]{40})\.(temp|fulltemp)\.jpeg$') { my ( $self, $c ) = @_; - my ( $hash ) = @{ $c->req->captures }; + my ( $hash, $size ) = @{ $c->req->captures }; my $file = file( $c->config->{UPLOAD_DIR}, "$hash.jpeg" ); my $photo = $file->slurp; - if ( $c->cobrand->default_photo_resize ) { - $photo = _shrink( $photo, $c->cobrand->default_photo_resize ); - } else { - $photo = _shrink( $photo, '250x250' ); + if ( $size eq 'temp' ) { + if ( $c->cobrand->default_photo_resize ) { + $photo = _shrink( $photo, $c->cobrand->default_photo_resize ); + } else { + $photo = _shrink( $photo, '250x250' ); + } } $c->forward( 'output', [ $photo ] ); |