Last modified: 2010-11-04 01:31:35 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 T7933, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5933 - Incorrect scaling of .svg->.png images.
Incorrect scaling of .svg->.png images.
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
PC Linux
: Normal normal with 3 votes (vote)
: ---
Assigned To: Ariel T. Glenn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-13 13:28 UTC by Tijmen Stam
Modified: 2010-11-04 01:31 UTC (History)
3 users (show)

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


Attachments

Description Tijmen Stam 2006-05-13 13:28:57 UTC
When uploading a .svg image mediawiki creates a .png version of it for easy viewing.  
In the page http://nl.wikipedia.org/wiki/Afbeelding:Honkbalposities.svg I found that the image uses is  
http://upload.wikimedia.org/wikipedia/nl/thumb/5/50/Honkbalposities.svg/1024px-Honkbalposities.svg.png which has  
dimension 1024x724px. Yet in the image description page, the <img> tag holding the .png gives a width="1052"  
height="744" pix, a scaling of 1.03%. Most browsers don't scale images very well using the <img width/height> tags,  
especially not in scaling factors near 100%. In this case, the image looks especially ugly (as if it was drawn with 
MS paint) 
  
Further testing revealed that using an [[Image: -tag with sizes of over 1024 pix on this image, the 1024px png was 
used, resulting in jagged or pixelized images. In using it with lower-resolution image tag sizes, the correct 
behaviour (creating a 300pix PNG based on the SVG) was shown.
Comment 1 Brion Vibber 2006-05-13 19:30:06 UTC
This is because there's currently a rendering limit of 1024 pixels set.
Comment 2 Tijmen Stam 2006-05-13 20:22:37 UTC
Aha, I understand. Then is it not an option for SVG images (which are scalefree) to set the img tag size (<img width=... height=...> 
to 1024 if the actual "size" (dimensions of the SVG document) are greater than these 1024 pixels. This solves the problems of ugly 
jagged because scaled images in the preview, and in my view, does not introduce any problems. (The only problem of scaling down 
pixel-sized structures to sized of less than one pixel is not valid as it is introduced by scaling to max 1024 pixels anyway.) 
Comment 3 Brion Vibber 2006-05-13 22:44:38 UTC
We don't support inline SVG at this time, only rasterized.
When inline SVG is supported, they will of course be client-side scaled.
Closing as INVALID again.
Comment 4 Tijmen Stam 2006-05-14 09:30:37 UTC
Well in the image description screen (the "wikiX.tld/wiki/Image:test.svg page) you DO have an inline SVG which is invalidly scaled. As  
most users see this screen first when they upload the image, and see it severely jagged, they think the image is b0rked and upload  
a .png instead (I am the "SVG authority" on the dutch wikipedia, at least 2 people told me they saw their SVG's were jagged and uploaded  
a PNG instead - undesirable behaviour IMHO). This can *easily* be fixed: the <img> tag in the image page should just show the 
width/height of the rendered image instead of using the .SVG sizes and invoking the client scaler. This is a waste at SVG scaling yields 
much better results than upscaling of PNG. 
 
Besides, for SVG images much bigger than 1024 pixels, you allready do this. For exampe: 
http://nl.wikipedia.org/wiki/Afbeelding:Spoorlijn_Groningen-Delfzijl.svg is rendered to 877x1023 pix and the image tag also reflects 
this size. Correct behaviour! (the underlying SVG is 300000 pix wide). 
Comment 5 Tijmen Stam 2006-05-14 16:13:08 UTC
Sorry, wrong understanding of the word "Inline" from my side. I'm not talking about inline SVG at all. I'm talking about the displaying 
of the PNG rasterized from the SVG. 
    
What happens is that mediawiki generates a PNG of size X,Y where X,Y=<1024. Yet, the <img> tag in the image page gives a width/height   
of > 1024 (1052 in this case) - information it got from the SVG document size <SVG:SVG width="841.88977pt"> which is 1052.36 px.  
  
Yet, for other images over 1024 px, you do get the width/height in the <img> tag <= 1024 where the source file is bigger!  
  
This is, IMHO, different behaviour in two simialar cases, hence, a bug. The <img> tag should *not* specify a size greater than the size  
of the rasterized PNG (=1024 right now), unless the user specifies it as such.  
Comment 6 Brion Vibber 2009-08-03 16:53:45 UTC
Assigning SVG bugs to Ariel -- need a cleanup pass to see what's fixed up by a librsvg upgrade, what can be resolved with fixes to our font configuration, what can be fixed on our end, and what still needs to be pushed upstream.
Comment 7 Derk-Jan Hartman 2010-11-04 01:31:35 UTC
Image has nominal size 1000x1000

Pref size: 800x600
<img alt="Bestand:Honkbalposities.svg" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Honkbalposities.svg/800px-Honkbalposities.svg.png" width="800" height="560">

Pref size: 1024x
<img alt="File:Honkbalposities.svg" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Honkbalposities.svg/1000px-Honkbalposities.svg.png" width="1000" height="700">

Seems this issue is fixed. No idea when.

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


Navigation
Links