From 362b8ca38939ca35dff8a04c0ac3434e6b3559cc Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Mon, 24 Jul 2017 13:36:52 +0100 Subject: 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. --- perllib/FixMyStreet/DB/Result/Problem.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm') 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); } -- cgit v1.2.3