From fbdcfca085f65c402c9c660d6d5d097f357f43a1 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Tue, 14 Dec 2021 19:36:25 +0100 Subject: ImageViewer: Improve smoothness of animated gif playback Don't disable grayscale overlay, don't show "resize" messages between frames and and don't clear display unless actually necessary Change-Id: I9f501d8280ce0c8f26f4345088d805d1b84cf143 --- apps/plugins/imageviewer/imageviewer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps/plugins/imageviewer/imageviewer.c') diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index a2b3bb680a..0dd140d1ab 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c @@ -915,7 +915,8 @@ static int load_and_show(char* filename, struct image_info *info) rb->lcd_update(); } - mylcd_ub_clear_display(); + if (frame == 0) + mylcd_ub_clear_display(); imgdec->draw_image_rect(info, 0, 0, info->width-info->x, info->height-info->y); mylcd_ub_update(); @@ -956,6 +957,7 @@ static int load_and_show(char* filename, struct image_info *info) get_view(info, &cx, &cy); cx /= zoom; /* prepare the position in the new image */ cy /= zoom; + mylcd_ub_clear_display(); } else continue; @@ -969,12 +971,14 @@ static int load_and_show(char* filename, struct image_info *info) } #ifdef USEGSLIB - grey_show(false); /* switch off overlay */ + if (info->frames_count <= 1) + grey_show(false); /* switch off overlay */ #endif rb->lcd_clear_display(); } while (status > PLUGIN_OTHER); #ifdef USEGSLIB + grey_show(false); /* switch off overlay */ rb->lcd_update(); #endif return status; -- cgit v1.2.3