diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-04-08 21:11:48 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-04-08 22:05:21 +0100 |
commit | b7099e8e513fe64ec183b1403515f46a7cc25f19 (patch) | |
tree | 8a0399a49f90acfe5b74cf19d86585cc050455d7 /perllib/FixMyStreet/Cobrand | |
parent | 0802b7f04091c1022dce0d77cc806a46ecc4ebba (diff) |
Add PNG image support.
Store image type along with hash in photo column, and use that when
outputting images / generating URLs. Make sure all public photo URL
generation goes through appropriate functions, and change temp URLs
so the filename can be output directly from the list.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 596ef2dc6..d31b1c84e 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -1018,14 +1018,15 @@ sub munge_sendreport_params { or return; my $id = $row->id; my @attachments = map { + my $image = $photoset->get_raw_image($_); { - body => $photoset->get_raw_image_data($_), + body => $image->{data}, attributes => { - filename => "$id.$_.jpeg", - content_type => 'image/jpeg', + filename => "$id.$_." . $image->{extension}, + content_type => $image->{content_type}, encoding => 'base64', # quoted-printable ends up with newlines corrupting binary data - name => "$id.$_.jpeg", + name => "$id.$_." . $image->{extension}, }, } } (0..$num-1); |