From 8033e9fef5ebfe657a944bb94dad4c3f93a24475 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Feb 2021 17:16:52 +0530 Subject: [PATCH] Fix error checking when rendering single frame --- kittens/tui/images.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kittens/tui/images.py b/kittens/tui/images.py index f5677c977..95a8a75fd 100644 --- a/kittens/tui/images.py +++ b/kittens/tui/images.py @@ -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 unseen: - raise ConvertFailed(path, f'Failed to render {len(unseen)} out of {len(m)} frames of animation') + 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