mediawiki-extensions-Popups/src
Sam Smith d4caff9774 rest: Don't scale unscalable thumbnails
If the image isn't an SVG then it shouldn't be scaled past its original
dimensions. Handle the case where the requested thumbnail can't be
generated on the server as the original is too small ( < 320px,
currently [0]) in the same way.

Moreover, if the image happens to have the exact dimensions that we're
requesting (300px or 600px wide, currently [1]), then use the original
image to avoid unnecessary work/pressure on caches.

Supporting changes:
* Update the SVG_RESTBASE_RESPONSE fixture to use the extension returned
  by RESTBase (and the PageImages extension) for the thumbnail:
  .svg.png.

[0] https://github.com/wikimedia/restbase/blob/master/v1/summary.yaml#L121
[1] https://github.com/wikimedia/mediawiki-extensions-Popups/blob/master/src/constants.js#L2

Bug: T156800
Change-Id: I5d0aa161e80869e4b4f5425d906d1e753047a3a3
2017-03-08 18:44:23 +01:00
..
changeListeners Hygiene: Remove global variable mw.popups in most places 2017-03-06 17:10:35 +01:00
gateway rest: Don't scale unscalable thumbnails 2017-03-08 18:44:23 +01:00
preview Hygiene: Remove duplicate file preview/index.js 2017-03-06 18:07:43 +01:00
reducers Hygiene: Remove checkin instrumentation 2017-02-27 14:48:47 +00:00
actions.js Hygiene: Remove global variable mw.popups in most places 2017-03-06 17:10:35 +01:00
actionTypes.js Hygiene: Remove checkin instrumentation 2017-02-27 14:48:47 +00:00
changeListener.js Hygiene: Move build/ext.popups/ to src/ 2017-02-14 09:59:59 -08:00
constants.js Resize thumbnails images returned by REST endpoint 2017-02-16 16:19:14 -08:00
counts.js Hygiene: Move build/ext.popups/ to src/ 2017-02-14 09:59:59 -08:00
index.js Hygiene: Remove global variable mw.popups in most places 2017-03-06 17:10:35 +01:00
isEnabled.js Hygiene: Remove global variable mw.popups in most places 2017-03-06 17:10:35 +01:00
previewBehavior.js Hygiene: Remove unnecessary IIFE in previewBehavior.js 2017-02-20 18:39:33 +01:00
processLinks.js Hygiene: Remove global variable mw.popups in most places 2017-03-06 17:10:35 +01:00
renderer.js Correct 1px offset error in SVG mask. 2017-03-03 11:38:40 -05:00
schema.js Hygiene: Remove unnecessary IIFE in schema.js 2017-02-20 18:39:47 +01:00
settingsDialog.js Hygiene: Remove useless IIFE in settingsDialog.js 2017-02-17 06:38:55 +01:00
userSettings.js Hygiene: Remove global variable mw.popups in most places 2017-03-06 17:10:35 +01:00
wait.js Hygiene: Remove unnecessary IIFE in wait.js 2017-02-17 06:38:46 +01:00