Last modified: 2011-05-14 23:51:26 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 T30940, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28940 - thumbs of SVG images where only height parameter is specified do not get scaled up beyond their "normal" width
thumbs of SVG images where only height parameter is specified do not get scal...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.17.x
All All
: High normal (vote)
: ---
Assigned To: Derk-Jan Hartman
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-11 19:34 UTC by Bergi
Modified: 2011-05-14 23:51 UTC (History)
5 users (show)

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


Attachments
Patch to make max height of an svg image only depend on $wgSVGMaxSize (790 bytes, patch)
2011-05-12 05:05 UTC, Bawolff (Brian Wolff)
Details

Description Bergi 2011-05-11 19:34:31 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.
Comment 1 Bawolff (Brian Wolff) 2011-05-12 04:57:44 UTC
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.
Comment 2 Bawolff (Brian Wolff) 2011-05-12 05:05:19 UTC
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.
Comment 3 Derk-Jan Hartman 2011-05-12 08:17:14 UTC
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.
Comment 4 Mark A. Hershberger 2011-05-12 22:43:36 UTC
(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?
Comment 5 Bryan Tong Minh 2011-05-14 09:06:16 UTC
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.
Comment 6 Bawolff (Brian Wolff) 2011-05-14 23:51:26 UTC
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]].

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


Navigation
Links