geotiffjs / geotiff.js

geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
https://geotiffjs.github.io/
MIT License
866 stars 182 forks source link

Do not crash for missing block from Map #417

Open keller-mark opened 8 months ago

keller-mark commented 8 months ago

Hi, I am encountering a case in which readRasters is failing due to encountering an undefined block during readSliceData. An extra check that each block is present in the Map resolves the issue and allows the image channels to load successfully.

The full error stack:

Uncaught (in promise) TypeError: can't access property "offset" of undefined
    readSliceData blockedsource.js:260
    readSliceData blockedsource.js:248
    fetch blockedsource.js:149
    getTileOrStrip geotiffimage.js:384
    _readRaster geotiffimage.js:478
    readRasters geotiffimage.js:610