Skip to content

Commit

Permalink
Merge pull request #14511 from spoyd/issue-14510
Browse files Browse the repository at this point in the history
issue-14510 use correct GeoTIFF value for image height in getResolutions
  • Loading branch information
tschaub committed Mar 4, 2023
2 parents 311d20a + e60d29c commit 507d92e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ol/source/GeoTIFF.js
Expand Up @@ -133,8 +133,7 @@ function getBoundingBox(image) {
try {
return image.getBoundingBox();
} catch (_) {
const fileDirectory = image.fileDirectory;
return [0, 0, fileDirectory.ImageWidth, fileDirectory.ImageLength];
return [0, 0, image.getWidth(), image.getHeight()];
}
}

Expand All @@ -148,7 +147,7 @@ function getOrigin(image) {
try {
return image.getOrigin().slice(0, 2);
} catch (_) {
return [0, image.fileDirectory.ImageLength];
return [0, image.getHeight()];
}
}

Expand All @@ -164,9 +163,8 @@ function getResolutions(image, referenceImage) {
return image.getResolution(referenceImage);
} catch (_) {
return [
referenceImage.fileDirectory.ImageWidth / image.fileDirectory.ImageWidth,
referenceImage.fileDirectory.ImageHeight /
image.fileDirectory.ImageHeight,
referenceImage.getWidth() / image.getWidth(),
referenceImage.getHeight() / image.getHeight(),
];
}
}
Expand Down

0 comments on commit 507d92e

Please sign in to comment.