Page MenuHomePhabricator

Previews not displaying non-free images
Closed, ResolvedPublic2 Estimated Story Points




  1. Visit
  2. Dwell on the "Non-free image" link.
  3. Wait for a preview to appear.
  4. Observe that the preview has a thumbnail.

The following is the original task description, which is no longer relevant as Page Previews started using RESTBase on the Beta Cluster on Tuesday, 28th February.


  • Windows 10 - Edge & IE11 & Chrome
  • Mac OS 10.12 - Chrome & Safari
  • OSX 10.11.6 - Firefox 51.0.1

Steps to recreate:

  1. on the beta cluster, search for "star wars" (
  2. hover over "star wars vs star trek"

Observed behavior: free image for "Star Wars" appears in preview
Expected behavior: non-free image for "Star Trek" appears in preview

Remember to add unit tests and test manually.

Event Timeline

Also happens on:
Windows 10 - Edge & IE11 & Chrome
Mac OS 10.12 - Chrome & Safari

@ovasileva - create a separate task for per-wiki configuration

bmansurov set the point value for this task to 2.

Upon investigation I noticed that the non-free image is not wide enough to be displayed in a preview. The thumbnail width should be 300px according to the code, but it is 509px which becomes 255px after accounting for the device pixel ratio.

@ovasileva, to sum it up, the image we're trying to display on retina displays is not big enough, thus not showing up at all. We could show a blurry image, but that's a design call imo.

@bmansurov - hmm, this still seems to be happening for some (but not all) non-free images. Some reproduction steps (in enwiki beta):

  1. Search for "escape from new york"
  2. Hover over "escape from new york"

Expected: image appears
Observed: image appears

  1. Hover over "escape from new york" (soundtrack)

Expected: image appears
Observed: image does not appear

A few observations from our (@ovasileva and my) conversation from IRC:

  1. Zooming in and out on a page affects the display of images. For example, when you're on the search results page for escape from new york and hover over the first link "Escape from New York" you'll either see an image or not. If you do, then try zooming in, then at some point you will not see the image. If you don't, then try zooming out, and the image will appear eventually. This is all due to how we display images based on their fit to the screen size and pixel ratio.
  1. Although both Escape from New York and Escape from New York (soundtrack) contain similar images, the latter page's image is non-free, that's why no image is appearing when you hover over "Escape from New York (soundtrack)" on the search page mentioned above. The non-free image does not appear because the MediaWiki API gateway used in production right now is not configured to return non-free images.
  1. A follow up patch will allow us querying the MediaWiki API to return images with any license.
  1. RESTBase is already returning any license image.

Change 340970 had a related patch set uploaded (by bmansurov):
[mediawiki/extensions/Popups] Allow showing non-free images when using MediaWiki API

I noticed this behavior on the beta cluster. This is a copy of the non-free image page that was setup on Staging.
URL - Hover over 'PreviewsNonFreeImage"

pasted_file (736Γ—1 px, 265 KB)

Change 340970 merged by jenkins-bot:
[mediawiki/extensions/Popups] Allow showing non-free images when using MediaWiki API

@bmansurov: Thanks for taking the time to write up the notes in T158632#3070472 β€οΈπŸ‘Œ I'm unsure if this was actually a bug or not, though…

I've merged and pulled rEPOPb40a24c15cc1: Allow showing non-free images when using MediaWiki API onto the staging server and see a preview with an image when hoving over the "Non-free image" link on

/cc @ovasileva

phuedx updated the task description. (Show Details)

@phuedx you're right. It was a feature request, not a bug.

Looks good so far in testing. Will take another look on Beta when it is (more) stable.

Target site -
Windows 10 - IE11
Windows 8.1 - IE11
Windows 8 - IE10
Windows 7 x64 - IE9 x64
Windows 10 - Edge
Windows 10 - Chrome 56