Last modified: 2014-05-23 00:48:38 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 T58508, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56508 - Default "Other resolutions" options do not make sense for SVG
Default "Other resolutions" options do not make sense for SVG
Status: RESOLVED DUPLICATE of bug 6834
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.23.0
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks: svg multimedia
  Show dependency treegraph
 
Reported: 2013-11-02 06:36 UTC by Dominic
Modified: 2014-05-23 00:48 UTC (History)
5 users (show)

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


Attachments

Description Dominic 2013-11-02 06:36:59 UTC
MediaWiki's default for generating "Other resolutions" options for PNG previews for SVG files seems to be based on the same logic as for other file formats (offer small- and medium-resolution versions smaller than the full resolution), when they can actually be rendered as PNG previews with resolutions much larger than the original SVG file's resolution. de.wp, en.wp, and Commons already have JS that under the mostly useless"Other resolutions" line generates a line that says "This image rendered as PNG in other sizes: 200px, 500px, 1000px, 2000px." See https://en.wikipedia.org/wiki/MediaWiki_talk:Common.js/Archive_17#SVG_files:_links_to_rendered_PNG_images

However, since these larger sizes are not offered by default by MediaWiki, it creates a confusing situation where some projects then have redundant lists of options offering previews of different resolutions, and all other MediaWiki projects are stuck with non-ideal "Other resolutions" options.

Compare https://commons.wikimedia.org/wiki/File:Meuble_h%C3%A9raldique_Crosse.svg (redundancy) and https://en.wiktionary.org/wiki/File:Meuble_h%C3%A9raldique_Crosse.svg (non-ideal options)

This is particularly problematic when the original SVG (as many are) has a resolution too small for MediaWiki to generate "Other resolutions" options, and then the user gets no PNG preview options at all.

Compare https://commons.wikimedia.org/wiki/File:Svg_example1.svg and https://en.wiktionary.org/wiki/File:Svg_example1.svg (nothing)

Ideally, SVG images should give PNG preview options like "200px, 500px, 1000px, 2000px" by default, even for very small SVG originals.
Comment 1 Marcin Cieślak 2013-11-04 10:55:55 UTC
I understand that one issue is that the preview size of SVG should be ignored here: 358                     # Generate thumbnails or thumbnail links as needed...

(from includes/IncludePage.php):
 359                     $otherSizes = array();
 360                     foreach ( $thumbSizes as $size ) {
 361                         if ( $size[0] < $width_orig && $size[1] < $height_orig
 362                             && $size[0] != $width && $size[1] != $height )
 363                         {
 364                             $sizeLink = $this->makeSizeLink( $params, $size[0], $size[1] );
 365                             if ( $sizeLink ) {
 366                                 $otherSizes[] = $sizeLink;
 367                             }
 368                         }

so we could remove "less that $width_orig, $height_orig" test here for SVG.

Regarding the list of offered sizes I am not sure but I think it is related to https://www.mediawiki.org/wiki/Manual:$wgImageLimits and user preferences; this setting can be tweaked, if necessary.
Comment 2 Bawolff (Brian Wolff) 2013-11-04 17:39:58 UTC
I agree, we should check isVectorized (or whatever the method is named) and only limit the sizes for raster images.

To clarify, you are just opposed to not returning the bigger than source sizes, you don't have any problems with the sizes offered in general (for big images)?
Comment 3 Dominic 2013-11-04 20:38:39 UTC
I think generally the options offered in "Other resolutions" don't make a lot sense, but they make the least sense for SVGs, and for a slightly different reason. But yes, for high-resolution files, it can be really odd when the only options you get range just from very-low-resolution to less-than-half original resolution, while for smaller images, they are closer to quarter-, half-, and three-quarter-resolution previews. I thought that might be a separate bug report, though. :-)
Comment 4 Bawolff (Brian Wolff) 2014-05-23 00:48:38 UTC
(In reply to Dominic from comment #3)
> I think generally the options offered in "Other resolutions" don't make a
> lot sense, but they make the least sense for SVGs, and for a slightly
> different reason. But yes, for high-resolution files, it can be really odd
> when the only options you get range just from very-low-resolution to
> less-than-half original resolution, while for smaller images, they are
> closer to quarter-, half-, and three-quarter-resolution previews. I thought
> that might be a separate bug report, though. :-)

Ok, I'm going to call this a dupe of bug 6834 which I just submitted a patch for. (That bug is that no sizes bigger than default size of svg is listed).

If you want the size choices to be different (e.g. Multiples of 10 instead of multiples of 80 or whatnot) please file a separate bug for that

*** This bug has been marked as a duplicate of bug 6834 ***

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


Navigation
Links