Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AbortSignal does not work when GeoTIFF constructors used #330

Open
anton-seaice opened this issue Nov 1, 2022 · 0 comments
Open

AbortSignal does not work when GeoTIFF constructors used #330

anton-seaice opened this issue Nov 1, 2022 · 0 comments

Comments

@anton-seaice
Copy link

In geotiff.js all the calls to GeoTIFF.fromSource are passing the abort signal to options.

fromSource is defined at line 546, and signal is the third argument:

 /**
   * Parse a (Geo)TIFF file from the given source.
   *
   * @param {*} source The source of data to parse from.
   * @param {GeoTIFFOptions} [options] Additional options.
   * @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
   *                               to be aborted
   */
  static async fromSource(source, options, signal) {

However, all calls lower in the file using signal as the second argument:
e.g. line 683

export async function fromUrl(url, options = {}, signal) {
  return GeoTIFF.fromSource(makeRemoteSource(url, options), signal);
}

And about 6 more examples do the same thing below that in the same file.

I suggest changing the order of the arguments for fromSource so it becomes static async fromSource(source, signal, options) ??

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant