Last modified: 2010-05-15 15:38:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 3127 - SVGs are not resized down properly on image pages
SVGs are not resized down properly on image pages
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Brion Vibber
Depends on:
  Show dependency treegraph
Reported: 2005-08-12 14:54 UTC by ejsanders
Modified: 2010-05-15 15:38 UTC (History)
1 user (show)

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


Description ejsanders 2005-08-12 14:54:36 UTC
SVGs are not resized down to fit on Image: pages. They are rendered at their
normal size, and then placed on the page with the width="800" (or whatever your
setting is) attribute set in the image tag, meaning they are only rescaled by
the browser. This is beacuse mustRender() (Image.php) returns true for SVG,
hoever simply adding "image/SVG" to this list of types that return false in this
function does not fix the problem, as this causes the SVGs to render to the
wrong path.

My hack invovled changing line 171 of ImagePage.php

  if ( !$this->img->mustRender() 
       && ( $width != $this->img->getWidth() || $height !=
$this->img->getHeight() ) ) {


  if ( (!$this->img->mustRender() || $this->img->getMimeType() == 'image/svg' )
       && ( $width != $this->img->getWidth() || $height !=
$this->img->getHeight() ) ) {

which solves the problem, but is it a bit ugly.
Comment 1 Brion Vibber 2005-09-11 01:08:38 UTC
I've simply removed the mustRender() check here as it doesn't serve any apparent 

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