Page MenuHomePhabricator

Optimal thumbnails for size vs. quality optimized book pages are not available
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
Available (linked) thumbnails are unreadable and so useless. 10-20% difference in size for optimized documents results in significant loss of quality.

What should have happened instead?:
Readable thumbnails with sizes as near to the actual page sizes need to be linked.
This probably can be achieved in one of 3 ways:

  • generating the thumbnails for actual page size (may be different for each page)
  • using more dense serie of widths (at least for multi-page documents)
  • using upsized thumbnails (eg. 960px in the abovementioned case) for linking to

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Krinkle subscribed.

It seems the preview on that file description page is rendered as follows:

<img alt="…" src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/A_list_of_books_….pdf/page19-500px-A_list_of_books_….pdf.jpg?_=…" … width="380" height="600" data-file-width="952" data-file-height="1514">

I notice two things:

  • It correctly applies a round-up thumbnail step to the 1x src (380px > 500px), which is generous and working as expected.
  • It fails to add a 2x srcset.

This should use a 952px thumbnail. Last week https://gerrit.wikimedia.org/r/1275921 changed this with the intention of rejecting thumbnails larger than 3840px (per T423895), but this had the side-effect of also disallowing thumbnails at the original size (eg. 952px), as well as of the regular steps (e.g. 960px) if it would require upscaling the original (T411076).

This should use a 952px thumbnail. Last week https://gerrit.wikimedia.org/r/1275921 changed this with the intention of rejecting thumbnails larger than 3840px (per T423895), but this had the side-effect of also disallowing thumbnails at the original size (eg. 952px), as well as of the regular steps (e.g. 960px) if it would require upscaling the original (T411076).

The patch you're describing hasn't been deployed yet so it has nothing to do with this and it's not the side effect of the aforementioned patch.

Ack.

[…] I'm wrong about your patch being the cause. Your patch hasn't been deployed yet. This is actually a regression from a bit longer ago. This bug is actually a side effect of the loop preferring to round down in this case by selecting a previous step, even when between two small steps at low resolutions. This is something we implemented previously, and may be worth handling differently. […]

Change #1276429 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] Media: Change wgThumbnailStepsRatio default from 0 to 1

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

Change #1276429 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] Media: Improve $wgThumbnailSteps docs

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

Change #1276429 merged by jenkins-bot:

[mediawiki/core@master] Media: Improve $wgThumbnailSteps docs

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

Change #1286330 had a related patch set uploaded (by Reedy; author: Krinkle):

[mediawiki/core@REL1_46] Media: Improve $wgThumbnailSteps docs

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

Change #1286331 had a related patch set uploaded (by Reedy; author: Krinkle):

[mediawiki/core@REL1_45] Media: Improve $wgThumbnailSteps docs

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

Change #1286332 had a related patch set uploaded (by Reedy; author: Krinkle):

[mediawiki/core@REL1_44] Media: Improve $wgThumbnailSteps docs

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

Change #1286333 had a related patch set uploaded (by Reedy; author: Krinkle):

[mediawiki/core@REL1_43] Media: Improve $wgThumbnailSteps docs

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

Change #1286333 merged by jenkins-bot:

[mediawiki/core@REL1_43] Media: Improve $wgThumbnailSteps docs

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

Change #1286330 merged by jenkins-bot:

[mediawiki/core@REL1_46] Media: Improve $wgThumbnailSteps docs

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

Change #1286331 merged by jenkins-bot:

[mediawiki/core@REL1_45] Media: Improve $wgThumbnailSteps docs

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

Change #1286332 merged by jenkins-bot:

[mediawiki/core@REL1_44] Media: Improve $wgThumbnailSteps docs

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