Page MenuHomePhabricator

<gallery mode=slideshow> creating hundreds of thumbnails
Open, Needs TriagePublicBUG REPORT

Description

MediaWiki 1.37.6

Using the following gallery tag:

<gallery widths=960px heights=540px perrow=3 mode=slideshow>
Image 1.png|Description 1
Image 2.png|Description 3
Image 3.png|Description 3
</gallery>

This is creating hundreds of thumbnails with every possible resolution

...
877px-Image_1.png
879px-Image_1.png
887px-Image_1.png
895px-Image_1.png
943px-Image_1.png
951px-Image_1.png
953px-Image_1.png
960px-Image_1.png
967px-Image_1.png
971px-Image_1.png
978px-Image_1.png
986px-Image_1.png
991px-Image_1.png
992px-Image_1.png
998px-Image_1.png

The image is 1920x1080px originally.

Expected behaviour is to function as other thumbnails, where only a dozen or so thumbnail sizes are created based on sizes used throughout the site.

This functionality seems to be configured in resources/src/mediawiki.page.gallery.slideshow.js.
A 4MB file is creating 500MB of thumbnails. Overall, 1 GB of files is creating 16GB of thumbnails.

Event Timeline

This is creating hundreds of thumbnails with every possible resolution

In which MediaWiki version? Please fill in the bug report template instead of deleting it - thanks a lot!

Prod updated the task description. (Show Details)

I've updated the mediawiki version and expected behaviour.

This recent commit may fix the issue rMW62763e5d52d519a8b08b8b178e0da34822367a08

@Prod: Can you still reproduce?

No, it doesn't fix the issue...

It's pretty easy to reproduce. View a gallery of type slideshow, open the browser's developer tools and be sure it's attached to the same window, docked at the bottom. Open the network tab of the developer console, and resize the developer console. Then navigate through the different images on the gallery. It fetches each image for the current size. Resize the window (or the developer console) and it fetches again new sizes of the images.

On resize, while it fetches through the api the new thumb sizes, it doesn't request a new image to be downloaded until you navigate to other images.