Last modified: 2011-05-14 23:51:26 UTC
Small SVG files embedded with [[File:foo.svg|x500px]] don't get enlarged. The png generator would work, but the wrong image is embedded: the one with the default size of the svg. Examples would be [[File:AB-Rast.svg|x30px]] or [[File:AB-AS.svg|x30px]]. This is not reproducable with every image.
Caused because if the width is unspecified, it is taken to be the normal width of the image. This makes sense for bitmap images where we don't want to scale beyond the natural width of the image. For vectorized images, less so.
Created attachment 8530 [details] Patch to make max height of an svg image only depend on $wgSVGMaxSize Here's a patch that changes it so the max width for vectorized images, when only the height is specified is $wgSVGMaxSize instead of being the actual width of the image. Not sure if this is the right place to put the check (but i guess where the current check already is). Also it kind of uses $wgSVGMaxSize in a more generic way (for all vectorized images, not just svgs) than the variable name would suggest. Something doesn't feel quite right about it. Anyways, I'm not sure if this patch is "right". I might commit it later when I'm not as tired.
Your weary feelings are not out of place. This part should not really be in Linker.php as far as I'm concerned. We should do parameter normalization in the imagehandlers (and I actually just added this for OggHandler, not yet committed). I'll try and look further into this, it's a tad of a mess it seems.
(In reply to comment #3) > I'll try and look further into this, it's a tad of a mess it seems. In the meantime, Bawolff, could you apply your patch?
I agree with Mark, it should be good enough for now. However, as TheDJ said, this code is a mess and should eventually be rewritten.
Applied in r88129. I'll open another bug about the whole Linker code thing. Before I forget, to anyone affected by this bug - the work around is to specify a really really big width. The intended effect could be accomplished with [[File:AB-Rast.svg|9999999999999999x30px]].