Last modified: 2010-05-15 15:38:44 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 T5127, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3127 - SVGs are not resized down properly on image pages
SVGs are not resized down properly on image pages
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.5.x
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Brion Vibber
http://commons.wikimedia.org/wiki/Ima...
:
Depends on:
Blocks:
  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: ---


Attachments

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
 from:

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

 to:

  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 
purpose.

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


Navigation
Links