You are not logged in.

#226 2011-09-05 14:27:40

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxiv - Simple image viewer written in C

karol wrote:
ber_t wrote:

Sorry, but I also do not plan to implement gif animation support. Please have a look at gifview, which comes with extra/gifsicle.

Static gifs work just fine.

The latest version can play animated GIF.
The one I'm posting is the only GIF, from the ones I've tested, which failed to play.


gh · da · ds

Offline

#227 2011-09-06 10:08:49

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

avx wrote:

I personally don't have caches or better, I've relocated them to RAM (SSD should not get trashed). Isn't there a way just to scale them, you know, like in HTML where you define w/h and the image gets scaled on the fly?

I don't really understand your point. Scaling is doable, but it takes some time. Rendering a bunch of dynamically scaled thumbnails is much more time consuming than the current approach, in which the thumbnails are scaled to a fixed size (given at compile time) only once when they're loaded. This makes it possible to directly render them afterwards without any postprocessing (possibly many more times).

bloom wrote:
karol wrote:
ber_t wrote:

Sorry, but I also do not plan to implement gif animation support. Please have a look at gifview, which comes with extra/gifsicle.

Static gifs work just fine.

The latest version can play animated GIF.
The one I'm posting is the only GIF, from the ones I've tested, which failed to play.

@karol: Well, seems my plan regarding gif animation has changed...
@bloom: The gif image you've uploaded is corrupted. But I've slightly changed the way in which sxiv handles corrupted gif files. It now loads/shows as much frames of such a corrupted gif image as possible.

Offline

#228 2011-09-06 16:00:46

avx
Member
Registered: 2011-07-05
Posts: 71

Re: sxiv - Simple image viewer written in C

ber_t wrote:
avx wrote:

I personally don't have caches or better, I've relocated them to RAM (SSD should not get trashed). Isn't there a way just to scale them, you know, like in HTML where you define w/h and the image gets scaled on the fly?

I don't really understand your point. Scaling is doable, but it takes some time. Rendering a bunch of dynamically scaled thumbnails is much more time consuming than the current approach, in which the thumbnails are scaled to a fixed size (given at compile time) only once when they're loaded. This makes it possible to directly render them afterwards without any postprocessing (possibly many more times).

As long as such a behaviour would be optional (ie something like a --dynamic parameter) I wouldn't care spending some CPU-cycles, I'd find it convinient for my use cases. Alternatively, since there's a -z to define a default zoom on the fly, there could be an equivalent for thumbsizes.

// ich geb ja zu, braucht nicht jeder

Offline

#229 2011-09-12 10:48:03

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxiv - Simple image viewer written in C

I though it would be useful to be able, in thumbnail mode, to select multiple items and to call a script with all the selected item's paths as argument.


gh · da · ds

Offline

#230 2011-09-15 19:29:41

hadrianw
Member
From: Szczecin, Poland
Registered: 2011-09-15
Posts: 5
Website

Re: sxiv - Simple image viewer written in C

Great tool!
Could you add xembed support?


Gentoo user here

Offline

#231 2011-09-25 10:44:28

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

@bloom: Maybe you can comment on this issue on sxiv's github site: https://github.com/muennich/sxiv/issues/13 I'm not sure yet how to implement selecting multiple images, so maybe you can join the discussion, before I start working on it. Thanks.

hadrianw wrote:

Could you add xembed support?

XEmbed support shouldn't be that hard to implement, but why do you need it? Do others in here also need/want this?

Offline

#232 2011-09-25 21:33:07

hadrianw
Member
From: Szczecin, Poland
Registered: 2011-09-15
Posts: 5
Website

Re: sxiv - Simple image viewer written in C

ber_t wrote:

XEmbed support shouldn't be that hard to implement, but why do you need it? Do others in here also need/want this?

I am planning to make something like crippled tabbed in two favors:
1st - pretty much like tabbed but without tabs wink - example work flow: xembedded terminal, launch something like 'surf -e $PARENT_XID' (or xembed enabled sxiv) and it's now in front (terminal is in background), exiting from surf - you go back to terminal
2nd - like 1st but only for single application (so if you embed another client previous will be closed)

2nd can be used as preview window for some simplistic file manager that I also plan to make. Both can be useful tools.

I hope that you can understand me smile


Gentoo user here

Offline

#233 2011-09-26 10:36:29

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: sxiv - Simple image viewer written in C

Is there some way for an external script to tell sxiv to load a particular image on the fly? It could be used to preview images with a file manager. :3 With XEmbed you could even embed both the file manager and sxiv in the same window.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#234 2011-09-26 11:07:16

hadrianw
Member
From: Szczecin, Poland
Registered: 2011-09-15
Posts: 5
Website

Re: sxiv - Simple image viewer written in C

hut wrote:

Is there some way for an external script to tell sxiv to load a particular image on the fly? It could be used to preview images with a file manager. :3

Yeah, but I would also want to preview other files in same window: html, pdf, svg etc. All with xembed enabled viewers.
Many times I want to check many files with different extensions, and I would really appreciate to view them in single window.
I am using tiling wm, so opening something moves and resizes windows. I don't like it for previews (and many times I need lots of them). I have to open file, check it, close it, repeat - all of this with unnecessary resizes. Anyways, there is more into it than additional resizes and keystrokes.

hut wrote:

With XEmbed you could even embed both the file manager and sxiv in the same window.

Of course that would be possible also and it would be cool smile


Gentoo user here

Offline

#235 2011-09-26 12:24:31

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

A little usability suggestion (and wish!), please excuse me if it has already been asked, but i didn't read all thread pages.
Can you add the ability to see previous and next images even if only an image is specified by the command line parameter?

thanks!


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#236 2011-09-26 12:32:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: sxiv - Simple image viewer written in C

kokoko3k wrote:

Can you add the ability to see previous and next images even if only an image is specified by the command line parameter?

space and backspace do this already - within the filelist specified by the commandline parameters.

Offline

#237 2011-09-26 12:34:46

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

Yeah, i mean to have the feature working even by specifying just one file.
-edit-
Another question: does sxiv preload the next image?

Last edited by kokoko3k (2011-09-26 12:35:31)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#238 2011-09-26 12:38:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: sxiv - Simple image viewer written in C

kokoko3k wrote:

Yeah, i mean to have the feature working by specifying just one file.

You can use '-n' switch.

It may get tricky if I run

sxiv *foo*

on

[karol@black foo]$ ls
total 0
-rw-r--r-- 1 0 09-26 14:33 001
-rw-r--r-- 1 0 09-26 14:33 002
-rw-r--r-- 1 0 09-26 14:33 003
-rw-r--r-- 1 0 09-26 14:33 1foo0
-rw-r--r-- 1 0 09-26 14:33 2foo0
-rw-r--r-- 1 0 09-26 14:33 3foo0
-rw-r--r-- 1 0 09-26 14:33 3foo3
-rw-r--r-- 1 0 09-26 14:33 4foo0
-rw-r--r-- 1 0 09-26 14:33 5foo0
-rw-r--r-- 1 0 09-26 14:33 abc
-rw-r--r-- 1 0 09-26 14:33 def
-rw-r--r-- 1 0 09-26 14:33 ghi

What would be the previous picture (assuming you can "go back" before the first picture in the list specified via the commandline - "wraparound")?

Last edited by karol (2011-09-26 12:41:02)

Offline

#239 2011-09-26 12:52:44

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

Think if i want to use sxiv to see images by a souble click in my desktop environment.
Double click on a file, then press space and see the next.
using "-n"  to achieve that would mean to write a wrapper script, isn't it?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#240 2011-09-26 13:06:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: sxiv - Simple image viewer written in C

Offline

#241 2011-09-26 13:17:27

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

Thanks, i saw until page 5 of the thread ^_^


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#242 2011-09-26 13:20:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: sxiv - Simple image viewer written in C

kokoko3k wrote:

Thanks, i saw until page 5 of the thread ^_^

You can change the number of posts per page in your forum profile under 'Display' - I have set mine to 75, so this thread has only 4 pages ;-P

Offline

#243 2011-09-28 20:02:42

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxiv - Simple image viewer written in C

ber_t wrote:

@bloom: Maybe you can comment on this issue on sxiv's github site: https://github.com/muennich/sxiv/issues/13

I'm the one who created the issue.


gh · da · ds

Offline

#244 2011-09-30 07:08:20

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

@ber_t:
sxiv is great, do you have plans to add the preoloading of the next and previous image to speed-up browsing?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#245 2011-09-30 09:20:50

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

kokoko3k wrote:

@ber_t:
sxiv is great, do you have plans to add the preoloading of the next and previous image to speed-up browsing?

I may look into it.

Offline

#246 2011-09-30 09:33:17

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

Thank you, ber_t.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#247 2011-10-14 09:09:35

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

@kokoko3k: Achieving a speed-up in browsing by preloading images isn't that easy. The loading of the images doesn't take a lot of time, whereas the rendering of the image accounts for most of the waiting time.

Pre-rendering images would require the usage of multiple threads and would thus vastly increase complexity. So, I don't plan to add it in the future. But I might add a configuration option to change Imlib2's cache size, which may result in shorter reloading times.

Offline

#248 2011-10-14 11:53:37

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,421

Re: sxiv - Simple image viewer written in C

Thanky you anyway for looking into it!


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#249 2011-10-17 12:50:53

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxiv - Simple image viewer written in C

I made a little script to move the current image to some directory.
The 'database' is just a list of directories (~ can be used, one directory per line).

#! /bin/sh

XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
MAX_LINES=128
move_places="$XDG_DATA_HOME/moveplaces"
places_temp="$XDG_DATA_HOME/moveplaces.tmp"
width_height=`xwininfo -root | grep -m 1 '\-geometry' | grep -oE '[0-9]+x[0-9]+'`

width=${width_height%x*}
height=${width_height#*x}
bar_width=$(($width / 2))
left_shift=$((($width - $bar_width) / 2))
top_shift=$(($height / 3))

fn='-*-terminus-medium-r-normal-*-28-*-*-*-*-*-iso10646-*'
nb='#282828'
nf='#928F88'
sb='#282828'
sf='#D8D4CB'

if [ ! -e "$move_places" ]; then
    touch "$move_places"
fi

destination=$(cat "$move_places" | dmenu -i -fn "$fn" -nb "$nb" -nf "$nf" -sb "$sb" -sf "$sf" -l 7 -x $left_shift -y $top_shift -w $bar_width)

if [ -n "$destination" -a $? -eq 0 ]; then
    destination=${destination//\~/$HOME}
    mv "$@" "$destination"
    destination=${destination//$HOME/\~}
    destination=${destination//\//\\\/}
    sed -i "1s/^/$destination\n/" "$move_places"
    cat "$move_places" | sort | uniq -c | sort -rn | sed 's/^[0-9 ]*//' | head -n $MAX_LINES > "$places_temp"
    mv "$places_temp" "$move_places"
fi

Last edited by bloom (2011-10-18 20:39:37)


gh · da · ds

Offline

#250 2011-10-17 14:06:15

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: sxiv - Simple image viewer written in C

bloom wrote:
#! /bin/sh

Use #!/bin/bash when you mean it.

----8<----
if [ -n "$destination" -a $? -eq 0 ]; then
    destination=${destination//\~/$HOME}
    mv "$@" "$destination"
    destination=${destination//$HOME/\~}
    destination=${destination//\//\\\/}
    sed -i "1s/^/$destination\n/" "$move_places"
    cat "$move_places" | sort | uniq -c | sort -rn | awk '{print $2}' | head -n $MAX_LINES > "$places_temp"
    mv "$places_temp" "$move_places"
fi

Very twisted and error-prone. Catch this:

if (( ! $? )) && [[ -n $destination ]]; then
    # Good enough if you don't need to support ~user or ~- expansions
    _destination=${destination/#\~/~}
    mv -t "$_destination" "$@"
    { printf '%s\n' "$destination"; cat "$move_places"; } | sort | ... > "$places_temp"
    mv -T "$places_temp" "$move_places"
fi

Last edited by lolilolicon (2011-10-17 14:28:36)


This silver ladybug at line 28...

Offline

Board footer

Powered by FluxBB