Skip to content

Commit

Permalink
Merge pull request #28 from originlake/load_image_error_info
Browse files Browse the repository at this point in the history
log corrupted image file name in imread
  • Loading branch information
pierotofy authored Feb 12, 2024
2 parents 9e7e6a2 + 1bbf1cc commit 097ef20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions opensfm/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,11 @@ def imread(
if ext.lower() == ".tiff" or ext.lower() == ".tif":
return imread_rasterio(path, grayscale, unchanged, anydepth)
else:
with open(path, "rb") as fb:
return imread_from_fileobject(fb, grayscale, unchanged, anydepth)
try:
with open(path, "rb") as fb:
return imread_from_fileobject(fb, grayscale, unchanged, anydepth)
except IOError:
raise IOError("Unable to load image {}".format(path))


def imread_from_fileobject(
Expand Down

0 comments on commit 097ef20

Please sign in to comment.