Skip to content

Commit

Permalink
Don't consider text files animations.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hzeller committed Dec 24, 2021
1 parent daa6f31 commit 6c843a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/image-display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6c843a3

Please sign in to comment.