Skip to content
Snippets Groups Projects
Verified Commit 8d8fe877 authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

check that the file could be read

parent 4c89f785
Branches
Tags
1 merge request!1Update Formats, Dependencies, and Dockerfile Configuration
...@@ -7,6 +7,10 @@ import os ...@@ -7,6 +7,10 @@ import os
def is_geotiff(resource, file_name): def is_geotiff(resource, file_name):
dataset = gdal.Open(file_name) dataset = gdal.Open(file_name)
if not dataset:
resource["error"] = f"could not read file {file_name}"
return False
geotransform = dataset.GetGeoTransform() geotransform = dataset.GetGeoTransform()
default_transform = (0.0, 1.0, 0.0, 0.0, 0.0, 1.0) default_transform = (0.0, 1.0, 0.0, 0.0, 0.0, 1.0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment