Skip to content

Commit

Permalink
Don't error if no size
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentao-Kuang committed Dec 10, 2024
1 parent e14d1af commit db4fab3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/commands/basemaps-topo-import/extractors/extract-bounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export async function extractBounds(tiff: Tiff): Promise<Bounds | null> {
* @returns if succeeded, a Bounds object. Otherwise, null.
*/
export function extractSize(tiff: Tiff): Size | null {
const size = tiff.images[0]?.size;
if (size == null || size.width == null || size.height == null) return null;
return size;
try {
const size = tiff.images[0]?.size ?? null;
return size;
} catch (e) {
logger.info({ found: false }, 'extractSize()');
return null;
}
}

0 comments on commit db4fab3

Please sign in to comment.