ckardaris / ucollage

An extensible command line image viewer inspired by vim
GNU General Public License v3.0
210 stars 3 forks source link

Setting a sort option leads to flickering and does not sort #19

Closed zupatisc closed 2 years ago

zupatisc commented 2 years ago

I have a ~/.config/ucollage/variables with the following options set:

export UCOLLAGE_LINES=5
export UCOLLAGE_COLUMNS=5
export UCOLLAGE_EXPAND_DIRS=1
export UCOLLAGE_SORT=extension
export UCOLLAGE_TMP_DIR=~/.cache/ucollage

All these options behave as expected except the one for sorting, ucollage still seems to sort by the default option. However if I try to set the sort option inside ucollage with the set command to either name, time or size ucollage will start flickering and become unresponsive. Trying to set the sort option extension will do nothing. The flickering is to my understanding due to a ton of errors being printed out, here is a small excerpt:

/usr/share/ucollage/src/filelist.sh: line 163: /home/drone/.cache/ucollage/7DjqPH/read_iter: No such file or directory
/usr/share/ucollage/src/filelist.sh: line 138: /home/drone/.cache/ucollage/7DjqPH/image_names.txt: No such file or directory
/usr/share/ucollage/src/filelist.sh: line 139: /home/drone/.cache/ucollage/7DjqPH/images.txt: No such file or directory
/usr/share/ucollage/src/filelist.sh: line 140: /home/drone/.cache/ucollage/7DjqPH/hash.txt: No such file or directory
/usr/share/ucollage/src/filelist.sh: line 141: /home/drone/.cache/ucollage/7DjqPH/dirty: No such file or directory

I have seen these errors differ at times, referencing ImageMagicks Montage tool at times but I can't save these logs as I have to kill the terminal due to all the ffprobe processes ucollage keeps spawning. Any idea or pointer on how to fix this would be much appreciated.

For completeness sake here are the version infos and installed optional deps:

 ~ 2$ pacman -Qi ucollage
Name            : ucollage-git
Version         : 1.0.1.r0.g0a6003a-1
Description     : Extensible command line image viewer inspired by vim
Architecture    : any
URL             : https://github.com/ckardaris/ucollage
Licenses        : GPL3
Groups          : None
Provides        : ucollage
Depends On      : bc  ueberzug
Optional Deps   : ffmpeg: video thumbnails [installed]
                  imagemagick: image rotation [installed]
                  xclip: clipboard pasting [installed]
Required By     : None
Optional For    : None
Conflicts With  : ucollage
Replaces        : None
Installed Size  : 136,43 KiB
Packager        : Unknown Packager
Build Date      : Fr 15 Apr 2022 00:27:09 CEST
Install Date    : Fr 15 Apr 2022 00:27:16 CEST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None
~ 2$ pacman -Qi imagemagick
Name            : imagemagick
Version         : 7.1.0.29-1
Description     : An image viewing/manipulation program
Architecture    : x86_64
URL             : https://www.imagemagick.org/
Licenses        : custom
Groups          : None
Provides        : libmagick
Depends On      : libltdl  lcms2  fontconfig  libxext  liblqr  libraqm  libpng  libxml2
Optional Deps   : ghostscript: PS/PDF support [installed]
                  libheif: HEIF support [installed]
                  libjxl: JPEG XL support
                  libraw: DNG support [installed]
                  librsvg: SVG support [installed]
                  libwebp: WEBP support [installed]
                  libwmf: WMF support [installed]
                  libxml2: Magick Scripting Language [installed]
                  libzip: OpenRaster support [installed]
                  ocl-icd: OpenCL support [installed]
                  openexr: OpenEXR support [installed]
                  openjpeg2: JPEG2000 support [installed]
                  djvulibre: DJVU support
                  pango: Text rendering [installed]
                  imagemagick-doc: manual and API docs
Required By     : libvips  zbar
Optional For    : feh  neofetch  pacgraph  python-matplotlib  ucollage-git
Conflicts With  : imagemagick6
Replaces        : imagemagick6  libmagick
Installed Size  : 10,84 MiB
Packager        : Artix Build Bot <jenkins@artixlinux.org>
Build Date      : So 27 Mär 2022 19:16:14 CEST
Install Date    : Di 29 Mär 2022 10:58:04 CEST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
ckardaris commented 2 years ago

Hello. Sorry for not replying right away. The truth is that ucollage is not one of my priorities currently. Another issue is that I am not actively utilizing the program for my own purposes, so I am not that motivated to work on it.

I reproduced your issue and have possibly pushed a fix on the dev branch. I am using a break_flag variable in order to check if I need to re-parse the input files (in case of sorting this is necessary since the sorting is done using ls). The error was that I was not clearing the flag, after acknowledging it, so the program was entering the main loop and breaking right away again and again. I don't know how I missed this.

On my machine it seems to basically work now, but I have not of course tested it for a long time. Build from the dev branch and tell me how it works for you.

zupatisc commented 2 years ago

Hi, thanks for the reply even if it isn't your priority anymore. I pulled your fix from the dev branch and now the sort runs through fine, however it seems that only the filename option actually works, the other options all seem behave like the filename option.

ckardaris commented 2 years ago

Unfortuantely I cannot reproduce that. You can check src/filelist.sh and check the commands. The order is produced by ls using the -S, -x, and -t flags for size, extension and time sort respectively.