I'm processing a lot of files where a few of them have some corruption and I want to be able to catch that, unfortunately in most cases no exception is raised, the only thing that happens is that a warning is printed. For instance the following code:
import rawpy
import imageio
with rawpy.imread("M0054341_01_00005.cr2") as raw:
rgb = raw.postprocess(output_bps=8, use_camera_wb=True, user_flip=0)
imageio.imsave('test.jpg', rgb)
I'm processing a lot of files where a few of them have some corruption and I want to be able to catch that, unfortunately in most cases no exception is raised, the only thing that happens is that a warning is printed. For instance the following code:
on the following file:
M0054341_01_00005.zip
results in the following warning printed:
and the following result:
Would it be possible to raise an exception in that case instead of printing a warning?