Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions xrspatial/geotiff/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1693,14 +1693,6 @@ def write(data: np.ndarray, path: str, *,

_write_bytes(file_bytes, path)

# Post-write validation: verify the header is parseable
from ._header import parse_header as _ph
try:
_ph(file_bytes[:16])
except Exception as e:
import warnings
warnings.warn(f"Written file may be corrupt: {e}", stacklevel=2)


def _compress_block(arr, block_w, block_h, samples, dtype, bytes_per_sample,
predictor: int, compression, compression_level=None,
Expand Down Expand Up @@ -2290,16 +2282,6 @@ def write_streaming(dask_data, path: str, *,
f.write(ifd_bytes)
f.write(overflow_bytes)

# Post-write validation
from ._header import parse_header as _ph
with open(tmp_path, 'rb') as f:
try:
_ph(f.read(16))
except Exception as e:
import warnings
warnings.warn(
f"Written file may be corrupt: {e}", stacklevel=2)

os.replace(tmp_path, path)
except BaseException:
try:
Expand Down
Loading