Fix error checking when rendering single frame

This commit is contained in:
Kovid Goyal 2021-02-04 17:16:52 +05:30
parent 83b8c8ea12
commit 8033e9fef5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -241,8 +241,11 @@ def render_image(
ff.truncate()
cd = create_canvas(data, f.width, f.canvas_x, f.canvas_y, ans.width, ans.height, 3 if ans.mode == 'rgb' else 4)
ff.write(cd)
if get_multiple_frames:
if unseen:
raise ConvertFailed(path, f'Failed to render {len(unseen)} out of {len(m)} frames of animation')
elif not ans.frames[0].path:
raise ConvertFailed(path, 'Failed to render image')
return ans