API: Fix imageinfo iiurlheight on audio files
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 21 Jun 2013 15:46:29 +0000 (11:46 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 24 Jun 2013 16:12:52 +0000 (12:12 -0400)
commit0f09d8ed2716d5e5da299b2380a0a4e06f677f05
tree8086e294bcd2a5639b8221e0044847ad564c8176
parenta2d0187b6f85856cfdc79acf7b53d61465cc4bf4
API: Fix imageinfo iiurlheight on audio files

When iiurlheight is given without iiurlwidth, we want to limit the
thumbnail by just the height. MediaWiki's file classes don't really
support this, though, so we pass the image's full width as the limiting
width to achieve the same effect.

However, this fails for audio files where $file->getWidth() returns 0,
but we can still get a thumbnail of a placeholder image. In that
situation, we should just choose an arbitrary non-zero limiting width.

Change-Id: I4318a06a96265d39e39e90cc706d49a1c3b6e8e3
includes/api/ApiQueryImageInfo.php