phillipberndt / pqiv

Powerful image viewer with minimal UI
http://www.pberndt.com/Programme/Linux/pqiv/index.html
GNU General Public License v3.0
307 stars 44 forks source link

several observations #74

Closed emdete closed 7 years ago

emdete commented 7 years ago

i have some observations when using pqiv the first time, did not want to make an issue each.

anyway, pqiv is a great program (i like the "remote control" by commands) that's why i put this together. hope it's understood as constructive contribution and not as idiotic rant :)

phillipberndt commented 7 years ago

Thank you for the input!

i did not find a way to disable the yellow image-name/number bar which is kind of ugly if i mainly want view my pictures.

Does i / --hide-info-box do the trick?

--scale-images-up does not work as expected, it does not scale the image up to the window size (for example to screensize in fullscreen), set_scale_mode_fit_px() does the trick. would be nice to have set_scale_mode_fit_px as commandline option.

Hm.. it should scale the image such that it always fits completely into the window, but such that at least one side does not have a black border. Doesn't it do that for you?

watching directories for added files does not work here (--watch-files --watch-directories given), not even a reload() did the trick.

Which filesystem do you use? NFS, by any chance?

emdete commented 7 years ago

yes, --hide-info-box works, i didn't spot it in the manpage. my fault :/

harhar, funny thing, giving --hide-info-box fixes the scaling as well :D may there be a bug? i get black borders on top/bottom/left/right with only --scale-images-up, it scales fine with --scale-images-up --hide-info-box. here is my complete commandline:

pqiv --hide-info-box --slideshow-interval=3 --lazy-load --slideshow --actions-from-stdin --scale-images-up --browse --shuffle --watch-files=on --watch-directories /mnt/nfs/remote/Pictures

which works as expected. removing --hide-info-box shows no skaling from the second pic viewed. --fullscreen does the trick as well.

and yes (as you see) i use a network filesystem, cifs to be correct.

do you think a warning is enough? here pqiv does not work correctly anymore with fade>slide.

another thing: pqiv should allow to start/encounter empty directories (showing black) and start when images appear (at least with --watch-directories), currently it terminates with No images left to display..

phillipberndt commented 7 years ago

and yes (as you see) i use a network filesystem, cifs to be correct.

Then that is the source of the issue. That's neither pqiv's nor glib's fault, the network file systems simply do not support the necessary inotify mechanism.

do you think a warning is enough? here pqiv does not work correctly anymore with fade>slide.

True, but I think that what I should do in the long run is to fix pqiv to make fade time > slideshow interval work. Also, I don't want to break existing scripts / use cases, although I've got to admit that it would be strange if someone used this on purpose.

another thing: pqiv should allow to start/encounter empty directories (showing black) and start when images appear (at least with --watch-directories), currently it terminates with No images left to display..

Thanks. That's a neat idea for a feature, I'll open a separate issue for that.

I'll look into the --hide-info-box / scaling problem when I find the time.

emdete commented 7 years ago

Then that is the source of the issue. That's neither pqiv's nor glib's fault, the network file systems simply do not support the necessary inotify mechanism.

okay, understood, but if i manually issue a reload() it should do so. in case i gave a dir the dir should be re-read (and at least all pics that changed), that is what the notification would trigger, right? or is reload() more watch-files related and not instead of a watch-directories?

phillipberndt commented 7 years ago

No, reload() (or r) only reloads the current file. Rescanning a directory is not currently supported, and not easy to implement, too, because pqiv needs to avoid rescanning directories in standard operation (because there might be recursive symlink looks), and currently does that using a fixed list of directories that it already scanned. I might (will probably) change that in a future release.

For now, a workaround is to use --actions-from-stdin and a shell script. Something like

 (while true; do find $DIR -printf 'add_file(%p);\n'; sleep 10; done) | ./pqiv --actions-from-stdin $DIR
emdete commented 7 years ago

but what does --watch-directories do then? i understood whatever is behind is triggered by reload()/r as well. your post sounds like another problem in case new directories show up, right? i am looking for a solution when files show up in a dir and inotify is not available. maybe a rescan() that just does not react on new dirs for now?

phillipberndt commented 7 years ago

reload() simply re-reads the current file from disk and displays it. --watch-directories uses inotify to be informed about new and/or deleted files, that is, it does never rescan entire directories, but entirely relies on Linux informing it about new files.

emdete commented 7 years ago

ah, ok, my fault: did not know how inotify works (thought it just notifies about changes in a dir).

phillipberndt commented 7 years ago

The two open requests are tracked in #76 and #77, I'll hence close this for now.

phillipberndt commented 7 years ago

FYI, I've fixed --slideshow-interval=1 --fade-duration=2 as far as possible now: Combining these options will now fade from 100% image1 to 50% image1 / 50% image2, then jump to 100% image2, fade to 50% image2 / 50% image3, then jump to 100% image3, and so forth.

emdete commented 7 years ago

cool! will check that soon :)

Flurrywinde commented 5 years ago

For now, a workaround is to use --actions-from-stdin and a shell script. Something like

 (while true; do find $DIR -printf 'add_file(%p);\n'; sleep 10; done) | ./pqiv --actions-from-stdin $DIR

I tried this but after a little while, it crashed:

(pqiv:21677): GLib-ERROR **: 09:04:48.785: creating thread 'image-loader-from-action': Error creating thread: Resource temporarily unavailable

My pqiv version is pqiv 2.11-1-gbaa1697-dirty. I'm on Ubuntu 18.04.