Skip to content

Commit

Permalink
Merge pull request #359 from will-moore/validate_zoomLevelScaling
Browse files Browse the repository at this point in the history
validate zoomLevelScaling
  • Loading branch information
jburel authored Feb 16, 2021
2 parents 726a906 + 89a1372 commit 2c9294f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/viewers/viewer/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,16 @@ class Viewer extends OlObject {
var dims = this.image_info_['size'];
if (this.image_info_['zoomLevelScaling']) {
var tmp = [];
for (var r in this.image_info_['zoomLevelScaling'])
tmp.push(1 / this.image_info_['zoomLevelScaling'][r]);
for (var r in this.image_info_['zoomLevelScaling']) {
// Data from server. Don't need to check for zero division
var scale = 1 / this.image_info_['zoomLevelScaling'][r];
if (scale <= tmp[tmp.length - 1]) {
// "Resolutions must be in descending order"
// https://github.com/ome/omero-iviewer/issues/358
break;
}
tmp.push(scale);
}
zoomLevelScaling = tmp.reverse();
}
var zoom = zoomLevelScaling ? zoomLevelScaling.length : -1;
Expand Down

0 comments on commit 2c9294f

Please sign in to comment.