You are not logged in.

#1 2010-06-20 23:21:51

alterecco
Member
Registered: 2009-07-13
Posts: 152

visible

Visible - Vimable simple image viewer (?)

On the tail of feh with vimbindings i though I might throw out there something I have had lying around for some time. I wanted to release it earlier, but started a slow rewrite in C. Perhaps it is good enough just to stay in python land and improve on it. The source should be really hackable (a single executable), and would no doubt relish some attention :)

For now it is a really simple image viewer written on top of the python GTK bindings. It uses 'hjkl' for panning images, 'n' and 'space' for next image, 'p' for previous (even if you only specified a single image). 'f' toggles between full size image/scaled to window size. There is no 'full screen' toggle; it is up to your WM to provide that imo. You can set it to display the list of images randomly, in which case 'space' will switch to next random image, while 'n' and 'p' will still browse to the next or previous image. 'i' and 'o' zoom the image in and out.

I will be glad to stick it on github if anyone feels like hacking it, or just take patches/suggestions/criticism.

.]

Last edited by alterecco (2010-06-21 16:31:03)

Offline

#2 2010-06-21 09:34:59

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: visible

Using gtk just to display images seems like overkill; why not use cairo directly?

large images scale down, small images should scale up.

vim bindings are nice, but completely customizable bindings are even better. although, with such a small file, it shouldn't be too hard to manually edit.


mad props on creating an image viewer in such a small file!

Offline

#3 2010-06-21 16:30:33

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: visible

I will have a look at using just cairo. I think something is needed for grabbing keys though... hmm

About scaling. I do not agree that small images should scale up. If you want to zoom, there is 'i' and 'o' (which i forgot to mention in my original post).

I will not include support for an rc file, since I want visible to be completely standalone, without writing to the filesystem. Like you say, it should be very easy to modify oneself. If it grows into a larger project, perhaps it should be easily customizable.

Offline

#4 2010-06-21 20:37:28

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: visible

alterecco wrote:

I do not agree that small images should scale up.

That's kind of a dealbreaker. When viewing slideshows especially, I want all my images scaled to window size, not just large images. Which leads to my next question:

Will you add slideshows, and image deletion, or are you commited to just viewing images ?

Offline

#5 2010-06-22 13:04:59

Barthalion
Forum Fellow
From: Poland
Registered: 2010-02-26
Posts: 111

Re: visible

Fullscreen only set image to 100%, not maximize window.

Offline

#6 2010-06-22 15:47:30

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: visible

@aerosynth: I might consider adding a --scale-up cmd line switch. I personally think it wrong to scale up an image beyond its resolution by default. Regarding slideshows, let's just say I thought about it, but not much more at this point. It is not something I have been needing myself. Regarding deletion of images, perhaps something like meh implements, where a keypress triggers a print of the filename to stdout. I am not convinced it would be right to add editor commands to visible at this point (if it was more full-fledged, perhaps). I have looked briefly into using Cairo directly, and as tempting as it may be, it seems it would mean writing the different image formats as surfaces individually, which I would like to avoid at this point. GTK gives good support for png, jpg and gif out of the box.

@Barthalion: I am not sure what you are referring to. visible has no `fullscreen' toggle. It has a key, 'f', which toggles between an image scaled to the viewport, and an image scaled to full size. What are you referring to with regards to 'maximize window'? Is that some behaviour you are seeing in your WM?

Last edited by alterecco (2010-06-22 15:50:02)

Offline

#7 2010-06-22 20:27:24

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: visible

@alterecoo: yeah I looked around a bit, and even on the cairo website itself they give examples using gtk. I started writing my own pygtk viewer, and it's pretty amazing how easy everything is - I've got a functional program in < 100 lines! I think I'll work on it until it's on par with yours, then I'll publish and we can maybe start collaborating.

I definitely think it's fine to stay in python land.

Offline

#8 2010-06-26 05:18:43

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: visible

I like it!


#!/vim/rocks

Offline

#9 2010-06-28 19:51:19

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: visible

What's the license on this? Also, are you still working on it?

Offline

#10 2010-06-30 07:24:28

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: visible

@aerosynth: I updated the file with a license header. It is realsed under MIT.

I am not actively working on it atm, but would still like to find time to improve it some day.

Offline

Board footer

Powered by FluxBB