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
878 stars 183 forks source link

Fix txml imports and alias #243

Closed ahocevar closed 3 years ago

ahocevar commented 3 years ago

This pull request adds an appropriate alias for txml in package.json's "browser" section, fixing the import in geotiffimage.js to work correctly in node, and removing the "alias" section in 'package.json`, which is no longer needed.

With this change, txml should work both in node (with transformStream) and browsers (using the recommended txml/dist/txml module, see https://github.com/TobiasNickel/tXml/blob/45566897f576558c1c5faaac47f3fdf9177adf49/README.md#installation).

Fixes #241.

ahocevar commented 3 years ago

This needs more work, or a fix in txml. Aliasing ./node_modules/txml/dist/txml for txml is not reliable.

ahocevar commented 3 years ago

This is now ready for review. txml is now pulled in correctly for both node and browser use, without aliasing to the node_modules/txml directory.

ahocevar commented 3 years ago

@constantinius Until #245 is ready, would it be possible to publish a release with the fixes from this pull request? OpenLayers users continue complaining about issues with geotiff.js, see e.g. openlayers/openlayers#12852. Thanks in advance!

constantinius commented 3 years ago

@ahocevar Version 1.0.7 should be available in some minutes, containing the fixes.