Page MenuHomePhabricator

Choose a sensible set of thumbnail sizes for Special:Preferences
Open, MediumPublic

Description

Main goal: Choose a sensible set of thumbnail sizes to offer in Special:Preferences. We should have fewer, carefully chosen options. Our choices should provide the maximum utility for different types of users (e.g., small size for people with low bandwidth and large size for people with high pixel density) while also being efficient with disk space and performance.

Current status: https://noc.wikimedia.org/conf/highlight.php?file=InitialiseSettings.php says (as of July 2015):

'wgThumbLimits' => array(
	'default' => array( 120, 150, 180, 200, 220, 250, 300, 400 ),
	'+itwikiquote' => array( 360 ),
	'svwiki' => array( 120, 200, 250, 300, 360 ),
),

MediaViewer uses these sizes: 320, 800, 1024, 1280, 1920, 2560, 2880

Because of retina support, we effectively support three times as many sizes as it looks like (at least for smaller ones):

120 => 120, 180, 240
150 => 150, 225, 300
180 => 180, 270, 360
200 => 200, 300, 400
220 => 220, 330, 440
250 => 250, 375, 500
300 => 300, 450, 600

Details

Event Timeline

I think we should build on multiples of 120 and 160. That should result in the following common cached image sizes: 120, 160, 180, 240, 320, 360, 480, 640, 720, 960, 1280, 1440, 1920... with 240 as the default.

That means no more 150 or 220 (and multiples of those).

That's one proposal for simplifying the list.

There's a larger list of options (not including the one above) at
https://www.mediawiki.org/wiki/Requests_for_comment/Standardized_thumbnails_sizes#Preferred_numbers
I'd tentatively suggest merging this task into that section? Or vice-versa.

FWIW, it's not as easy as it looks since mediawiki stores the preferences as array keys so if we remove one size, everyone's preference gonna shift (I know...) it's not impossible to solve but someone needs to do the coding and fixing.

FWIW, it's not as easy as it looks since mediawiki stores the preferences as array keys so if we remove one size, everyone's preference gonna shift (I know...) it's not impossible to solve but someone needs to do the coding and fixing.

PHP arrays can have holes in them, $wgThumbLimits too.

Current value is [ 120, 150, 180, 200, 220, 250, 300, 400 ], or:

[
	0 => 120,
	1 => 150,
	2 => 180,
	3 => 200,
	4 => 220,
	5 => 250,
	6 => 300,
	7 => 400,
]

New standard sizes are: [ 20, 40, 60, 120, 250, 330, 500, 960 ].

So, you can just remove some values from that array (or change them to new values, if they're close enough), and add any new ones with bigger indices than the old ones, and things should work out just fine. Values that are no longer valid should revert to the default. For example:

[
	0 => 120,
	5 => 250,
	8 => 330,
]

I haven't tested this, but I looked at the code and it looks like it should work. At worst we'll need some small bugfixes, not redoing the whole system.

Oh that's a nice trick. I hate this way that php handles arrays but it's useful sometimes.

I'll do a query to see how many people enabled different thumbnail sizes and if the number is quite small for a given thumbnail size, we can remove it. I think it's also okay to change an existing one, e.g. the 300 to 330px

Total number of thumb sizes:

{'6': 5873x, '7': 5374x, '0': 2438x, '1': 668x, '5': 7377x, '3': 4956x, '2': 1696745x, '4': 378x, '8': 1x}

Suggestions:

  • Kill 0 (120px) and 1 (150px) migrate users to 2 (180px)
  • Kill 3 (200px) migrate users to 4 (220px)
  • Change 6 from 300px to 330px
  • Merge 7 (400px) into 6 (now 330px)

?

Change #1251196 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] Limit and standardize thumbnail options

https://gerrit.wikimedia.org/r/1251196