On Thu, Mar 8, 2012 at 12:39 PM, Jeroen De Dauw jeroendedauw@gmail.com wrote:
Hey,
I'm seeing some weird behavior and can't figure out what's going on.
I have some code making a request to the API to obtain the thumb url of an image: http://dpaste.org/nuOfX/
This code is used here, and right now the first two images are full size and the third is a thumb: http://education.wmflabs.org/wiki/Special:CampusAmbassadors
No idea why it's working for some and not for others. Stranger yet, I cannot reproduce this issue locally, running the same code. This is with trunk and with instant commons on.
I don't know why this happens, but you really don't need internal API requests to get thumbnail URLs. This is much simpler:
$file = wfFindFile( 'Foobar.jpg' ); $thumb = $file->transform( array( 'width' => 200 ) ); if ( $mto && !$mto->isError() ) { $url = $mto->getURL(); } else { /* Handle error */ }
Roan