developmentseed / developmentseed/async-tiff

`rust future panicked: unknown error` when opening TIFF files

Open
#97 10 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
120
Forks
15
Avg merge
1d 17h
Merged PRs (30d)
9

Description

Here is an MVCE for rust panics I encountered when building virtual_tiff. The TIFFs are from GDAL's test suite. You can change `file_id` to switch which TIFF is being opened.

```Python
import obstore as obs
from async_tiff import TIFF
from async_tiff.store import LocalStore
import os
import asyncio

# Set which file to run the test on
file_id = 0

# Download file
store = obs.store.HTTPStore.from_url("https://dagshub.com")

panics = [
("gdal_gcore", "huge-number-strips.tif"),
("gdal_gcore", "byte_user_defined_geokeys.tif"),
("gdal_gcore", "minimum_tiff_tags_no_warning.tif"),
("gdal_gcore", "uint16_sgilog.tif"),
("gdal_gcore", "corrupted_gtiff_tags.tif"),
("gdal_gcore", "gtiff_towgs84_override.tif"),
("gdal_gcore", "minimum_tiff_tags_with_warning.tif"),
("gdal_gcore", "bigtiff_header_extract.tif"),
("gdal_gcore", "spaf27_markedcorrect.tif"),
("gdal_gcore", "huge-implied-number-strips.tif"),
("gdal_gcore", "excessive-memory-TIFFFillStrip2.tif"),
("gdal_gcore", "packbits-not-enough-data.tif"),
("gdal_gcore", "excessive-memory-TIFFFillStrip.tif"),
("gdal_gcore", "byte_bigtiff_invalid_slong8_for_stripoffsets.tif"),
("gdal_gcore", "weird_mercator_2sp.tif"),
("gdal_gcore", "many_blocks_truncated.tif"),
("gdal_autotest", "epsg_27563_allgeokeys.tif"),
("gdal_autotest", "nodata_precision_issue_float32.tif"),
("gdal_autotest", "byte_coord_epoch.tif"),
("gdal_autotest", "projected_GTCitationGeoKey_with_underscore_and_GeogTOWGS84GeoKey.tif"),
("gdal_autotest", "nodata_precision_issue_float32.tif"),
("gdal_autotest", "missing_tilebytecounts_and_offsets.tif"),
]
path = f"maxrjones/virtual-tiff/raw/73934fbfb31cd5bb099f225a47ac8ea34298f3ea/tests/dvc/{panics[file_id][0]}/{panics[file_id][1]}"

resp = obs.get(store, path)
with open(panics[file_id][1], "wb") as f:
for chunk in resp:
f.write(chunk)

# Attempt to open file using async_tiff
async def open_tiff(*, store, path):
return await TIFF.open(path, store=store)

store = LocalStore()
filepath = f"{os.getcwd()}/{panics[file_id][1]}"

tiff = asyncio.run(open_tiff(store=store, path=filepath))
print(tiff)

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.