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:
Aaron Arcos 2014-01-27 17:08:00 -08:00
parent 567039c14e
commit 7c87033235
2 changed files with 4 additions and 3 deletions

View file

@ -278,7 +278,8 @@
}
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
};
};

View file

@ -467,7 +467,7 @@
widths = viewer.getImageSizeApiArgs(ui);
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
ui.$imageWrapper.height(600);
@ -476,7 +476,7 @@
widths = viewer.getImageSizeApiArgs(ui);
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();
} );