mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-28 18:10:06 +00:00
Request maximum image resolution in the API call.
After checking all the code paths (phew !), it seems this simple change takes care of the resolution issue that surfaces mainly in iOS devices (see b/60388). Bug: 60388 Change-Id: I867dd18f782126fb71eb52ec637a2b90b910050d
This commit is contained in:
parent
567039c14e
commit
7c87033235
|
@ -278,7 +278,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
requested: requestedWidth,
|
// Factor in pixel ratio so we get as many pixels as the device supports, see b/60388
|
||||||
|
requested: requestedWidth * $.devicePixelRatio(),
|
||||||
target: calculatedMaxWidth || targetWidth
|
target: calculatedMaxWidth || targetWidth
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -467,7 +467,7 @@
|
||||||
widths = viewer.getImageSizeApiArgs(ui);
|
widths = viewer.getImageSizeApiArgs(ui);
|
||||||
|
|
||||||
assert.strictEqual(widths.target, 150/100*200, 'Correct target width was computed.');
|
assert.strictEqual(widths.target, 150/100*200, 'Correct target width was computed.');
|
||||||
assert.strictEqual(widths.requested, 320, 'Correct requested width was computed.');
|
assert.strictEqual(widths.requested, 320 * $.devicePixelRatio(), 'Correct requested width was computed.');
|
||||||
|
|
||||||
// Fake viewport dimensions, width/height == 1.0, we are limited by width
|
// Fake viewport dimensions, width/height == 1.0, we are limited by width
|
||||||
ui.$imageWrapper.height(600);
|
ui.$imageWrapper.height(600);
|
||||||
|
@ -476,7 +476,7 @@
|
||||||
widths = viewer.getImageSizeApiArgs(ui);
|
widths = viewer.getImageSizeApiArgs(ui);
|
||||||
|
|
||||||
assert.strictEqual(widths.target, 600, 'Correct target width was computed.');
|
assert.strictEqual(widths.target, 600, 'Correct target width was computed.');
|
||||||
assert.strictEqual(widths.requested, 640, 'Correct requested width was computed.');
|
assert.strictEqual(widths.requested, 640 * $.devicePixelRatio(), 'Correct requested width was computed.');
|
||||||
|
|
||||||
ui.unattach();
|
ui.unattach();
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue