aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Photo.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm1
3 files changed, 2 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index f72478cff..b53b6ab06 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -7,6 +7,7 @@ BEGIN { extends 'Catalyst::Controller'; }
use POSIX qw(strftime strcoll);
use Digest::MD5 qw(md5_hex);
use mySociety::EmailUtil qw(is_valid_email);
+use if !$ENV{TRAVIS}, 'Image::Magick';
use FixMyStreet::SendReport;
@@ -1289,7 +1290,6 @@ sub trim {
sub _rotate_image {
my ($photo, $direction) = @_;
- use Image::Magick;
my $image = Image::Magick->new;
$image->BlobToImage($photo);
my $err = $image->Rotate($direction);
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm
index fc4c3fde7..fa4baf045 100644
--- a/perllib/FixMyStreet/App/Controller/Photo.pm
+++ b/perllib/FixMyStreet/App/Controller/Photo.pm
@@ -9,6 +9,7 @@ use Digest::SHA1 qw(sha1_hex);
use File::Path;
use File::Slurp;
use Path::Class;
+use if !$ENV{TRAVIS}, 'Image::Magick';
=head1 NAME
@@ -116,7 +117,6 @@ sub no_photo : Private {
# Shrinks a picture to the specified size, but keeping in proportion.
sub _shrink {
my ($photo, $size) = @_;
- use Image::Magick;
my $image = Image::Magick->new;
$image->BlobToImage($photo);
my $err = $image->Scale(geometry => "$size>");
@@ -130,7 +130,6 @@ sub _shrink {
# Shrinks a picture to 90x60, cropping so that it is exactly that.
sub _crop {
my ($photo) = @_;
- use Image::Magick;
my $image = Image::Magick->new;
$image->BlobToImage($photo);
my $err = $image->Resize( geometry => "90x60^" );
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index a4462e035..43ce0e876 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -6,7 +6,6 @@ BEGIN { extends 'Catalyst::Controller'; }
use FixMyStreet::Geocode;
use Encode;
-use Image::Magick;
use List::MoreUtils qw(uniq);
use POSIX 'strcoll';
use HTML::Entities;