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
845 stars 175 forks source link

Abort signal should be extended to `getImage` when performing slice's fetch action #408

Open dsuren1 opened 8 months ago

dsuren1 commented 8 months ago

Description

Currently it is not possible to perform abort fetch action on fromUrl, fromCustomClient, fromArrayBuffer, fromFile & fromBlob as reported in this existing issue.

When this issue is addressed it would be nice to have this feature extended to getImage.

getImage performs a parseFileDirectoryAt to fetch DataSlice via getSlice. This call could end up expensive based on the tif source size, hence it would be nice to have abort signal passed down to getSlice from getImage to cancel the fetch action when required. This feature could ensure completeness in the abort action using geotiff fetch and image parsing.