utils: raspberrypi: ctt: load_image: Ignore JPEG files with no raw data
The load_image function would throw errors with JPEG or JPG files containing no raw data. Prevent throwing these errors by returning 0 if an error has occurred. Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
2778c3298c
commit
ed12bb4aba
1 changed files with 5 additions and 0 deletions
|
@ -358,6 +358,11 @@ def load_image(Cam, im_str, mac_config=None, show=False, mac=True, show_meta=Fal
|
|||
Img = dng_load_image(Cam, im_str)
|
||||
else:
|
||||
Img = brcm_load_image(Cam, im_str)
|
||||
"""
|
||||
handle errors smoothly if loading image failed
|
||||
"""
|
||||
if Img == 0:
|
||||
return 0
|
||||
if show_meta:
|
||||
Img.print_meta()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue