From 6c843a3ef18b485b3e39aefa11f13f14cd131a7a Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Fri, 24 Dec 2021 10:37:03 -0800 Subject: [PATCH] Don't consider text files animations. Files with file-ending of "txt" are now considered multi-frame images not displayed as animation. That allows all of them to be shown and not get stuck in a forever-animation if this is the only file given on the command line Issues #68 --- src/image-display.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/image-display.cc b/src/image-display.cc index 5386ab0..8f5cfe0 100644 --- a/src/image-display.cc +++ b/src/image-display.cc @@ -161,8 +161,9 @@ bool ImageLoader::LoadAndScale(const DisplayOptions &opts, // got back (or is there ?), so we use a blacklist approach here: filenames // that are known to be containers for multiple independent images are // considered not an animation. - const bool could_be_animation = - !EndsWith(filename(), "ico") && !EndsWith(filename(), "pdf"); + const bool could_be_animation = !EndsWith(filename(), "ico") && + !EndsWith(filename(), "pdf") && + !EndsWith(filename(), "txt"); // We can't remove the offset yet as the coalesceImages() might need images // prior to our desired set.