Last modified: 2013-12-17 09:28:07 UTC
This exception is very commonly logged at WMF: 2013-11-11 07:11:16 mw1157 commonswiki: [f882bb2e] /w/thumb.php?f=Wikibooks.png&w=50 Exception from line 61 of /usr/local/apache/common-local/php-1.23wmf2/includes/media/ImageHandler.php: No width specified to ImageHandler::makeParamString #0 /usr/local/apache/common-local/php-1.23wmf2/includes/filerepo/file/File.php(808): ImageHandler->makeParamString(Array) #1 /usr/local/apache/common-local/php-1.23wmf2/includes/filerepo/file/File.php(790): File->generateThumbName('Wikibooks-logo.png', Array) #2 /usr/local/apache/common-local/php-1.23wmf2/thumb.php(187): File->thumbName(Array) #3 /usr/local/apache/common-local/php-1.23wmf2/thumb.php(52): wfStreamThumb(Array) #4 /usr/local/apache/common-local/php-1.23wmf2/thumb.php(35): wfThumbHandleRequest() #5 /usr/local/apache/common-local/w/thumb.php(3): require('/usr/local/apache/common-local/php-1.23wmf2/thumb.php') #6 {main} It is apparently due to ccf89be91a4. The handling of backwards-compatible "w" parameters was moved to after the relevant thumbName() call. This bug demonstrates a pre-existing error-handling issue. For example: http://commons.wikimedia.org/w/thumb.php?f=Wikibooks.png This throws an exception. It should show an error message instead. But some media types (for example, videos) allow the width to be omitted, so it's not correct to just check for a missing width parameter in thumb.php. If the parameters are invalid, MediaHandler::normaliseParams() should return false, and indeed ImageHandler does just that: if ( !isset( $params['width'] ) ) { return false; } ... if ( !$this->normaliseParams( $image, $params ) ) { return new TransformParameterError( $params ); } So makeParamString() should probably fail silently, returning 0px-Wikibooks.png or some other similar garbage, so that parameter errors can be extracted from the MediaTransformOutput returned from transform().
Note that the exception with the "w" parameter specified occurs when the requested image is a redirect.
Change 94844 had a related patch set uploaded by Tim Starling: thumb.php: map b/c params prior to attempting redirection https://gerrit.wikimedia.org/r/94844
Change 94844 merged by jenkins-bot: thumb.php: map b/c params prior to attempting redirection https://gerrit.wikimedia.org/r/94844
tstarling: Did your patch fix most issues here? Wondering about the bug status and the current frequency in logs.