Giter Site home page Giter Site logo

phillipberndt / pqiv Goto Github PK

View Code? Open in Web Editor NEW
284.0 15.0 42.0 2.59 MB

Powerful image viewer with minimal UI

Home Page: http://www.pberndt.com/Programme/Linux/pqiv/index.html

License: GNU General Public License v3.0

Makefile 2.24% C 91.71% Shell 0.09% Roff 5.96%
image-viewer command-line c graphics gtk3 pdf-viewer animation-viewer

pqiv's Issues

Watch directories for changes

This feature has been requested by numerous users. It should be quite easy to add it via gio's file system monitoring, which internally uses inotify under Linux. I'll add it in the first release after 2.0.

Does a non-recursive option make any sense?

Following on to issue #21, we decided not to reimplement the "bug" where directories passed in via stdin weren't recursive, but those on the commandline were.

Is it worth having a commandline option to disable directory recursion? It could be useful if you had a directory structure where you had foo, foo/bar, and foo/baz, but only wanted images in foo and foo/baz; you could list them, and specify the non-recursive option, and get the desired behavior.

However, this adds knobs and buttons to the app, and so I'm not sure whether it's worth it. It's nice to be able to replicate the behavior of the 1.x series, even if it was a bug.

Of course, with -r working again, I suppose you could tell people to construct a pipeline, as well, a la find foo foo/baz -type f -maxdepth1 | pqiv -r.

What are your opinions on this? I'd sign up to implement it if you think it'd be useful.

Release 2.3

With #30 closed and the bunch of new features that came with #29, I should probably do a release soon. As usual, I'll wait about a month to see if there are any bugs.

Use-after-free with multi-page PS files

How to reproduce:

  • Setup a directory with one image and one multi-page PS file
  • Start pqiv
  • Remove the PS file

Valgrind / gcc's sanitize scripts do not help, the error is an unspecific *** Error in ./pqiv: corrupted double-linked list: 0x000000000071f340 ***

Wrong image order

Command line: pqiv a.jpg b.jpg c.jpg

Expected behavior:
Pqiv displays the three images in the same order as they appear in the command line.

Actual behavior:
They are displayed in the reverse order -- first c.jpg, then b.jpg, and finally a.jpg.

I use git version of pqiv.

watch directories can result in still showing deleted image

The --watch-directories option work very well but I've noticed that if you delete all but one image from a source folder, pqiv in slideshow mode, will show this last image plus one other. I'm guessing there is some internal cache of images that is not being fully cleared? Many thanks for looking into it.

Build issue on Ubuntu+1

cc  -Wall -Wextra -Wfloat-equal -Wpointer-arith -Wcast-align -Wstrict-overflow=5 -Wwrite-strings -Waggregate-return -Wunreachable-code -Werror -Wno-unused-parameter -std=gnu99 -o pqiv `pkg-config --cflags gtk+-3.0 glib-2.0 cairo gio-2.0` pqiv.c lib/strnatcmp.o `pkg-config --libs gtk+-3.0 glib-2.0 cairo gio-2.0` -O3 
pqiv.c: In function ‘do_jump_dialog’:
pqiv.c:1601:3: error: ‘GtkStock’ is deprecated [-Werror=deprecated-declarations]
   GTK_STOCK_OK,
   ^
cc1: all warnings being treated as errors
make: *** [pqiv] Error 1

Fullscreen doesn't work with awesome wm

Under the awesome tiling window manager, full-screen mode seems to have a problem. The result is the same when I toggle it either via the wm controls or via the 'F' key: the image window has either full height but less than full width or full width but less than full height. I'm attaching a screenshot. Awesome has a floating mode as well as a tiling mode, but the mode makes no difference.

It seems the problem manifests only if the first image to appear is smaller than the screen in either dimension. For example, my screen is 1280x1024 - if 1.png is smaller than this and 2.png is equal or bigger, running:

pqiv -f 1.png 2.png

results in a full-screen window that doesn't cover the screen (even when switching between the images), while running:

pqiv -f 1.png 2.png

results in a true full-screen window which stays full-screen.

Could this be a problem at pqiv's end, or should I ask at the awesome mailing lists?

untitled

Memory leak on PNG files

Look, here is example of bug. Pqiv can't open file, but it's process gets all RAM.
m1_20150520_124716

top
873,2m 269,1m  43,0  4,6   0:54.70 R pqiv

Image's not broken, it's SSTV dump made with QSSTV

Release 2.2

If no new bugs arise within this week, I'll release 2.2.

--watch-directories With Images Downloading in the Background

I've been trying having pqiv --watch-directories run for a directory under /tmp while aria2c downloads images in the background. It works okay, but I have to ensure that an image exists before starting pqiv or it will exit. Sometimes I want to clear all the images in the directory and then re-populate it with other images. This also can cause pqiv to close. Would it be possible to have pqiv stay open even in an empty directory (by default or with another option)?

Another problem is that pqiv will sometimes read an image before it is fully downloaded, causing it to fail and never be loaded. I'm not sure if there is a good way to deal with this though. I guess pqiv could retry reading failed images a few times, but for such a limited use case, it probably doesn't make sense to add that functionality. I realize that I can just pass pqiv a bunch of urls, but this is slow, and I want to be able to update/add to the images later.

Option to Start at a Certain Image Number

I'd like to add pqiv integration to ranger (the open_all_images option). This requires the image viewer to have an option to start at a image other than the first one (e.g. --start-at 2 would show the second image initially), so that the user's place in the file manager is maintained.

Delayed Zoom

Zooming works fine on animated images, but when I try to zoom on a normal image, nothing happens until I take some wm action like switching desktops (after which it will redisplay with zoom). I'm using bspwm, but I haven't noticed anything like this happen for other programs. Any ideas about what might be causing this?

Sort by date

Can --browse be sorted by file creation time?

pqiv won't open

Everytime i use a command pqiv only displays the Help but dose not start. I have reinstalled it multiple times but allways get this error. If you tell me what informations you need to help me i would post them.

scale-images-up in .pqivrc causes SEGV

If the scale-images-up=1 is in .pqivrc, it causes a SEGV fault in pqiv on my raspberry pi. I believe this is likely to happen with any option that uses the underlying CALLBACK framework in the code.

The fix for me was simple (two changes on line 590 in the current pqiv.c code)

 (*(GOptionArgFunc)(iter->arg_data))(iter->long_name, option_value, NULL, &error_pointer);
/* INSTEAD OF
** (*(GOptionArgFunc *)(iter->arg_data))(NULL, option_value, NULL, &error_pointer);
*/

Thanks for creating this utility. It's working well for what I needed it for.

Inconsistent Left Click / Spacebar operation

Whenever I left or right click to change images, it skips every other file, or at least it appears that way, I only have four files in the directory. If I hit the spacebar, it cycles through all the images as expected.

Fix bostree thread safety

When moving backwards through a file list containing lots of corrupt images, the BOSTree can become corrupt. This is due to a race between the unloading function in the image loader and the main thread.

My initial attempts to fix this in ede5ce7 and 0d803c7 did not give the desired solution.

Load directories in the background

Do not wait until all images are loaded, display as soon as we've got something.

This requires some changes:

  • Images must be sorted upon insertion into the search tree, not afterwards
  • current_image must be kept up-to-date
  • The argument vector must be handled in a separate thread

Release 2.1

If no new bugs arise until in about 2 weeks, I should release 2.1.

Add --browse

qiv added --browse some time ago:

--browse, -B           Useful when launching from a file manager

When #24 is resolved, this option would make sense for pqiv, too.

Implementing this should be pretty straight-forward, except for the question how to prevent the image from being added twice (once from the command line, once from the directory traversal).

Show cursor in fullscreen

Sometimes it is needed to use mouse cursor in full-screen mode and it
Looks like there is no way in pqiv to show it. I solved this problem
By adding c' to show cursor andC' to hide it again:

Diff --git a/pqiv.c b/pqiv.c
Index bc85565..589a2a3 100644
--- a/pqiv.c
+++ b/pqiv.c
@@ -3487,6 +3487,13 @@ gboolean window_key_press_callback(GtkWidget *widget, GdkEventKey *event, gpoint
          }
          break;

+     case GDK_KEY_c:
+                       fullscreen_show_cursor();
+         break;
+     case GDK_KEY_C:
+                       fullscreen_hide_cursor();
+         break;
+
      case GDK_KEY_H:
      case GDK_KEY_h:
          {

But probably making a flag "needs to hide cursor in fullscreen",
Setting it from command line and being able to toggle it (like
Main_window_in_fullscreen) is more intuitive.

toggle shuffle mode

I was wondering if it would be possible to add a hotkey that allows you to toggle the shuffle mode on and off while you are viewing images.

The way I imagine it would work is as follows:

  • User starts pqiv with the --shuffle option to flip randomly through a large collection of images
  • User sees something he likes, and wants to see the next or previous image in the set rather than the next random image
  • User presses the hotkey "R" (for random) to toggle shuffle mode off, so that he can view the images that are alphabetically adjacent to the one he was viewing.

Some Suggestions for User-set Key Bindings

First of all, thank you for the nice image viewer. I've tried countless ones in the past, and this one is probably my favorite so far.

I think that having named actions instead of aliasing keys to other keys would be more readable. This would be especially nice for allowing for an arbitrary number of shell commands to be bound to any key (instead of using something like command-1=... with keyboard-alias=a1). It might also be nice to allow binding a key to change a specific option's value (e.g. set slideshow-interval to 0.5). To improve readability further, I think it would be nice to allow for multiple keyboard-alias options to be specified. I've changed a lot of the key bindings in the config file, and the rebinds I've made are not at all obvious from looking at a bunch of characters. Also, I'm not sure how to rebind keys like control- or space (or if it's possible).

Another feature that would be great is support sequence key bindings. As a simple example, zi could be bound to zoom in, and zo could be bound to zoom in. If this ends up being implemented, I think it would be preferable to wait for the end of a chain or for an unbound key press instead of timing out. For example, if z, zi, and zo were bound, pressing z would wait for the next key press (as opposed to eventually timing out to the action bound to z). If i or o was pressed after the z, the bound actions would happen. If a key unbound at that level was pressed, it would reset to the "top level" key bindings.

Some of these requests would require changing the keybinding syntax. If you like any of the ideas, I'd recommend something similar to the following:

bind-key=<key> <action>
# single key
bind-key=a slideshow-toggle
# key sequence
bind-key=zi zoom-in
# control + f
bind-key=c-f fullscreen-toggle
# special characters
bind-key=<space> next-image
# g followed by space followed by control + f
bind-key=g<space>c-f shell-command ...

Finally, I think it would be nice to be able to unbind a key (bind to no action)

About the --max-depth

pqiv is a great command line tool! When I want use it as my default Image viewer, I encounter a problem:
when I use --browse, pqiv default load all images under the image's directory, including images in subdirectories, and
when --max-depth=1, pqiv will go into 1 levels of directories below current directory. That's reasonable, but
when --max-depth=0, pqiv will load only the one image I open.
So, how could I load the images in the current directory of the image I open(not include images in subdirectories), just like a normal Image Viewer.

Loading of big images blocks pqiv

This is not a threading related issue, but a logical error: current_image is updated before the new image is actually loaded. But keyboard and mouse input block if the current_image is not loaded.

Maybe waiting with updating current_image until the image is actually loaded will resolve this. But then I'd have to implement some mechanism to prevent the new image from popping up if the user has decided to move to another image in the meantime.

Add fading between images

See title. Suggested by Martin Herrmann and others. Old versions of pqiv had this already. This time I will write the code such that fading is also possible between images of different size.

Window focus in 3.5.7 not correct

Certain applications are not focussed correctly when they are in maximized mode in a tag.
I noticed this problem with firefox, thunar and wireshark. It happens both in "fair" layout and in floating layout.

Steps to reproduce:
Start one of the above mentioned applications in a clean tag.
Maximize the window.
switch tags and switch back again
open some other windows
close the other windows.
try to close the maximized window.

Expected result:
all applications that are opened can be closed correctly, including the maximized one.

Actual result:
The other applications are closed, but the maximized one can not be closed.
It can also not be minimized or made fullscreen or any other action that requires a focussed window.

Let me know if you can confirm this issue.

I'm now using version 3.5.6 which does not have this problem.

Webm support

Pretty much no linux image viewer supports it and I do not feel comfortable with a media player. May this happen eventually?

Slideshow with shuffle on 2 photos seems to get stuck

I've just noticed that a slideshow with 2 photos, will rotate a few times and then get stuck - not moving on to the next photo.

I've not seen this before and wonder it its due to some recent changes?

Command is:

pqiv -s -f -F -d 10.0 --fade-duration=0.8 --watch-directories --shuffle <folder containing 2 images>

I'm using 1a1b528

Many thanks for looking.

Why was the -r option removed?

I use pqiv extensively and appreciate it, but I found the 2.x release (and unfortunately, the 1.x release won't compiler for me) removed the -r ("Read additional filenames (not folders) from stdin") option.

I cannot find the devlopment history between pqiv 1.0 (on the gtk2 branch) and the initial commit of the 2.x RC code, so it's hard to tell why this option was removed?

I think it'd be easy to add back (and, in fact, I'm happy to submit a pull-request that does exactly that), but I don't want to waste my time if there was an actual reason it was removed.

Issues with rewrite branch

Hi Phillip, thanks a lot for doing this great application! I've just tested the rewrite branch (which has been labelled "semi-stable"), and it appears I have encountered the following two issues:

  1. "--hide-info-box" is documented, but doesn't work. Variable option_hide_info_box is never used.

  2. I have several image files slightly smaller than my screen size (between 80% and 100%). I used to use "-t" twice to prevent them from being scaled. With the rewritten version, it appears neither "-t -t" nor "--disable-scaling" works as expected.

Feature request, --once option

Would it be possible to add a new option, say, --once that would mean pqiv starts in slideshow mode, displays all pictures available just once and then exits? In other words, it does not wrap around.

Probably this new option would be ignored if --shuffle was supplied?

Many thanks for consideration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.