On Thu, Mar 8, 2012 at 1:24 PM, Jeroen De Dauw <jeroendedauw(a)gmail.com>wrote;wrote:
Hey,
$file = wfFindFile( 'Foobar.jpg' );
$thumb = $file->transform( array( 'width' => 200 ) );
if ( $mto && !$mto->isError() ) { $url = $mto->getURL(); } else { /*
Handle error */ }
I tried your code, and now all my images are "FOOBAR". It does not work!
;)
More seriously though: I updated my code to use this
indeed better way to
get the thumb (
http://dpaste.org/XIr5W/ ), but the problem appears to be
completely unaffected :/
I'm not sure why the width parameter doesn't seem to be taking effect in
the transform.... but rather than creating your own <img> element you may
wish to use $thumb->toHtml() just for consistency.
Hmm... it looks like there's a bug in thumbnailing with InstantCommons here.
at
http://education.wmflabs.org/wiki/File:Kitten%27s_paw.jpg the thumbnail
in the version dialog is also actually pulling in a full-size image.
Checking a direct api hit to Commons:
https://commons.wikimedia.org/w/api.php?action=query&titles=File:Kitten…
note there's a separate 'url' (the original size url) and 'thumburl'
(scaled url). Don't see an obvious reason for breakage though... seems ok
in my local trunk instances too.
-- brion