aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-07-24 13:36:52 +0100
committerDave Arter <davea@mysociety.org>2017-07-24 13:36:52 +0100
commit362b8ca38939ca35dff8a04c0ac3434e6b3559cc (patch)
tree8eadac1a40250387b88391ce3cade85451009d2a
parent9168cd769df03bf657fee4d287b5ef1ed11bde8e (diff)
Resize pin image before compositing onto static map
A recent change doubled the size of the pin images, which meant the static maps included in report emails had the pin in the wrong place because the compositing code made assumptions about the pin size which were wrong. This commit ensures the pin image is of a known size before compositing, putting the pins back in the right place.
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index f62ed6d47..f353c02ee 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -1083,6 +1083,7 @@ sub static_map {
if ($pin) {
my $im = Image::Magick->new;
$im->read(FixMyStreet->path_to('web', 'i', 'pin-yellow.png'));
+ $im->Scale( geometry => '48x64' );
$image->Composite(image => $im, gravity => 'NorthWest',
x => $pin->{px} - 24, y => $pin->{py} - 64);
}