Re: [mySociety:public] Image size of getMP

2 views
Skip to first unread message

Terence Eden

unread,
Feb 25, 2010, 4:10:32 PM2/25/10
to develope...@lists.mysociety.org
To add image_height & image_weight to the output should be as simple as changing

if ($image) $row['image'] = $image;

to

if ($image) {
list($width, $height) = getimagesize($image);
$row['image'] = $image;
$row['image_height'] = $height;
$row['image_width'] = $width;
}

Within
api_getMLA.php
api_getMP.php
api_getMSP.php
api_getPerson.php

I'm currently unable to test this on a local install, nor work out the
extra computational effort it would involve.
For those interested in the inner workings of getimagesize() -
http://php.net/manual/en/function.getimagesize.php

Would anyone be able to test before I spend weeks swearing at my
computer trying to get the codebase working? :-)

Terence

Matthew Somerville

unread,
Feb 25, 2010, 5:22:39 PM2/25/10
to mySociety public, general purpose discussion list
Terence Eden wrote:
> To add image_height & image_weight to the output should be as simple as changing

[snip]

Ta, applied (fixed the path for where the image will actually be, and
tidied up all that get* code so it doesn't need to be in four different
places, but just one, whilst I was there).

ATB,
Matthew

Reply all
Reply to author
Forward
0 new messages