Skip to content

Commit

Permalink
log corrupted image file name in imread
Browse files Browse the repository at this point in the history
  • Loading branch information
originlake committed Feb 12, 2024
1 parent 729339d commit 1bbf1cc
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 1bbf1cc

Please sign in to comment.