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.
Fixes #318 and the problems reported in the aftermath of #284.
The problem after #284 is that when the cacheSize is smaller than the number of blocks for one set of requests, blocks that were properly loaded are not available because they were evicted from the cache already. With this change, the last evicted set of blocks is still available during the whole process of fetching a set of blocks.
I also removed the note in the README about setting cacheSize: 0, because quick-lru does not even accept 0 as cache size, and I think the problem that led to that note in the README no longer exists with this pull request.
@constantinius Can you please try to prioritize a review on this? The issue fixed here blocks us from updating geotiff.js in OpenLayers. Thanks in advance!
Fixes #318 and the problems reported in the aftermath of #284.
The problem after #284 is that when the
cacheSize
is smaller than the number of blocks for one set of requests, blocks that were properly loaded are not available because they were evicted from the cache already. With this change, the last evicted set of blocks is still available during the whole process of fetching a set of blocks.I also removed the note in the README about setting
cacheSize: 0
, becausequick-lru
does not even accept0
as cache size, and I think the problem that led to that note in the README no longer exists with this pull request.