File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -382,12 +382,12 @@ class GeoTIFFImage {
382382 offset = this . fileDirectory . StripOffsets [ index ] ;
383383 byteCount = this . fileDirectory . StripByteCounts [ index ] ;
384384 }
385- const slice = ( await this . source . fetch ( [ { offset, length : byteCount } ] , signal ) ) [ 0 ] ;
386385
387386 let request ;
388387 if ( tiles === null || ! tiles [ index ] ) {
389388 // resolve each request by potentially applying array normalization
390389 request = ( async ( ) => {
390+ const slice = ( await this . source . fetch ( [ { offset, length : byteCount } ] , signal ) ) [ 0 ] ;
391391 let data = await poolOrDecoder . decode ( this . fileDirectory , slice ) ;
392392 const sampleFormat = this . getSampleFormat ( ) ;
393393 const bitsPerSample = this . getBitsPerSample ( ) ;
@@ -408,6 +408,11 @@ class GeoTIFFImage {
408408 // set the cache
409409 if ( tiles !== null ) {
410410 tiles [ index ] = request ;
411+ request . catch ( ( ) => {
412+ if ( tiles [ index ] === request ) {
413+ tiles [ index ] = null ;
414+ }
415+ } ) ;
411416 }
412417 } else {
413418 // get from the cache
You can’t perform that action at this time.
0 commit comments