geotiff.js
geotiff.js copied to clipboard
repeated parsing of file directories by every getImage call
As shown below, every call to getImage() calls await this.parseFileDirectoriesPerFile() without using the result. parseFileDirectoriesPerFile() saves the result in this.fileDirectoriesPerFile but that variable is never referenced. The result is that every call to getImage() calls parseFileDirectoryAt() for every file for no reason.
https://github.com/geotiffjs/geotiff.js/blob/af0421bb6cfbb16a3d68aff54cb50f9d8824017f/src/geotiff.js#L613-L634
Just to note, this only affects the MultiGeoTIFF class (overviews in separate files). The single-file case looks OK.