Permalink
Browse files

Add helpful error if image is corrupted

  • Loading branch information...
1 parent 04ea59f commit effc9d7b8c0d0fa506374824b4a807f366a8068b @blixt blixt committed Nov 23, 2015
Showing with 5 additions and 1 deletion.
  1. +5 −1 prepro.py
View
@@ -183,7 +183,11 @@ def main(params):
for i,img in enumerate(imgs):
# load the image
I = imread(os.path.join(params['images_root'], img['file_path']))
- Ir = imresize(I, (256,256))
+ try:
+ Ir = imresize(I, (256,256))
+ except:
+ print 'failed resizing image %s - see http://git.io/vBIE0' % (img['file_path'],)
+ raise
# handle grayscale input images
if len(Ir.shape) == 2:
Ir = Ir[:,:,np.newaxis]

0 comments on commit effc9d7

Please sign in to comment.