List of steps to reproduce (step by step, including full links if applicable):
- Set $wgUseImageMagick = false in LocalSettings.php.
- Either:
- Make sure ImageMagick (/usr/bin/convert) is not installed, or
- Set $wgImageMagickConvertCommand to a nonexistent path.
- Upload a .webp image file.
What happens?:
At the upload's File: page, there is a broken image, with an error message that shows MediaWiki tried to run ImageMagick:
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127
What should have happened instead?:
Based on the variable name, I expected that setting $wgUseImageMagick to false would cause ImageMagick never to be used. Acting on that expectation, I disabled the setting as a security hardening measure. Instead, it seems the meaning of $wgUseImageMagick = false is more like: prefer other image libraries if available, but use ImageMagick anyway if it is the only option.
I expected that if $wgUseImageMagick were false and ImageMagick were the only available scaler for an image file format, the image would remain unthumbnailed.
For me, an additional clarification at https://www.mediawiki.org/wiki/Manual:$wgUseImageMagick would be a sufficient fix. Another sufficient fix would be a way to override mustRender for WebP, so that the .webp file can be shown to browsers directly, without needing to be converted to .jpg.
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
MediaWiki 1.37.2
This is where the "im" scaler is hardcoded for WebP:
https://gerrit.wikimedia.org/g/mediawiki/core/+/71c81003ead8e26caf239a109b121df9d7cccd68/includes/media/WebPHandler.php#283
It looks like the same situation exists with XCF (I noticed because the comment in WebPHandler.php is copied from XCFHandler.php):
https://gerrit.wikimedia.org/g/mediawiki/core/+/71c81003ead8e26caf239a109b121df9d7cccd68/includes/media/XCFHandler.php#168