Last modified: 2013-12-17 09:28:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58924, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56924 - Exception with thumb.php?w=xxxx: No width specified to ImageHandler::makeParamString
Exception with thumb.php?w=xxxx: No width specified to ImageHandler::makePara...
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 02:49 UTC by Tim Starling
Modified: 2013-12-17 09:28 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Starling 2013-11-12 02:49:40 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().
Comment 1 Tim Starling 2013-11-12 03:16:24 UTC
Note that the exception with the "w" parameter specified occurs when the requested image is a redirect.
Comment 2 Gerrit Notification Bot 2013-11-12 04:00:40 UTC
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
Comment 3 Gerrit Notification Bot 2013-11-12 18:08:04 UTC
Change 94844 merged by jenkins-bot:
thumb.php: map b/c params prior to attempting redirection

https://gerrit.wikimedia.org/r/94844
Comment 4 Andre Klapper 2013-11-25 17:13:49 UTC
tstarling: Did your patch fix most issues here? Wondering about the bug status and the current frequency in logs.
Comment 5 Andre Klapper 2013-12-17 09:28:07 UTC
tstarling: Did your patch fix most issues here? Wondering about the bug status
and the current frequency in logs.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links