You are not logged in.
ber_t, would you consider adding the original resolution/depth of the image to the title?
I've added the image dimension. I've found no API-function in imlib2 for getting the depth of an image, so I couln't add this one.
EDIT: @karol: The wiki says, that the script should be called with a single file as the first argument, it then gives all the other files in the same directory as the file to sxiv. So there's no need to use a wildcard when calling it.
Last edited by ber_t (2011-05-22 17:49:15)
Offline
Thanks ber_t!
ᶘ ᵒᴥᵒᶅ
Offline
EDIT: @karol: The wiki says, that the script should be called with a single file as the first argument, it then gives all the other files in the same directory as the file to sxiv. So there's no need to use a wildcard when calling it.
I thought that it should work anyway ;P Thanks!
I assumed that
The script assumes the first argument is the filename.
was about the order of the arguments and
Invoke the script with the selected images path
made me think it's OK to specify multiple images (edited it to read 'selected image's path').
Offline
Hello, the script don't work properly with sxiv. for example I have 3 picture if i open the number 2 with the script they are in this order 2 > 3 > 1 . If I use the script with feh no problem it's 1 < 2 > 3. Any tips to fix this.
Offline
Hello, the script don't work properly with sxiv. for example I have 3 picture if i open the number 2 with the script they are in this order 2 > 3 > 1 . If I use the script with feh no problem it's 1 < 2 > 3. Any tips to fix this.
That's because the script is relying on the fact, that feh sorts its arguments while keeping track of their ordering on the command line. Change the script to the following and it should work (only the last two lines were changed):
#!/bin/bash
shopt -s nullglob
if [[ ! -f $1 ]]; then
echo "$0: first argument is not a file" >&2
exit 1
fi
file=$(basename -- "$1")
dir=$(dirname -- "$1")
arr=()
shift
cd -- "$dir"
for i in *; do
[[ -f $i ]] || continue
arr+=("$i")
[[ $i == $file ]] && c=$((${#arr[@]} - 1))
done
r=$((${#arr[@]} - $c - 1))
exec sxiv "$@" -- "${arr[c]}" "${arr[@]:0:c}" "${arr[@]:c+1:r}"
Offline
With regard to the new script:
I'm not sure if I'm doing it right, but now the picture I pick to start with is simply dragged to the front. If I pick, say, picture number 3, instead of the regular 1 > 2 > 3 > 4 > 5 sequence, I get 3 > 1 > 2 > 4 > 5.
Offline
With regard to the new script:
I'm not sure if I'm doing it right, but now the picture I pick to start with is simply dragged to the front. If I pick, say, picture number 3, instead of the regular 1 > 2 > 3 > 4 > 5 sequence, I get 3 > 1 > 2 > 4 > 5.
You're not the only one.
Offline
With regard to the new script:
I'm not sure if I'm doing it right, but now the picture I pick to start with is simply dragged to the front. If I pick, say, picture number 3, instead of the regular 1 > 2 > 3 > 4 > 5 sequence, I get 3 > 1 > 2 > 4 > 5.
sxiv doesn't sort its arguments, but keeps them in the same order they're given on the cmdline, so it doesn't fully work with the feh-script from the wiki.
You want the perfect behaviour? Use sxiv-git from the AUR (new option -n) and change the script to:
#!/bin/bash
shopt -s nullglob
if [[ ! -f $1 ]]; then
echo "$0: first argument is not a file" >&2
exit 1
fi
file=$(basename -- "$1")
dir=$(dirname -- "$1")
arr=()
shift
cd -- "$dir"
for i in *; do
[[ -f $i ]] || continue
arr+=("$i")
[[ $i == $file ]] && n=${#arr[@]}
done
exec ~/work/github/sxiv/sxiv -n $n "$@" "${arr[@]}"
This still loads images twice, if you call the script with more than one file.
Last edited by ber_t (2011-05-25 07:32:01)
Offline
You want the perfect behaviour? Use sxiv-git from the AUR (new option -n) and change the script to:
#!/bin/bash shopt -s nullglob if [[ ! -f $1 ]]; then echo "$0: first argument is not a file" >&2 exit 1 fi file=$(basename -- "$1") dir=$(dirname -- "$1") arr=() shift cd -- "$dir" for i in *; do [[ -f $i ]] || continue arr+=("$i") [[ $i == $file ]] && n=${#arr[@]} done exec ~/work/github/sxiv/sxiv -n $n "$@" "${arr[@]}"
This still loads images twice, if you call the script with more than one file.
Thank you now work the way I want
Offline
script changes and sxiv-git don't work together for me. Not a really big deal though. Just thought it was something I'd try.
Offline
I've got a quick question/feature request. I didn't find it earlier in the thread, but admittedly I only skimmed through it. I am using v.0.8.1 from the community repo.
I'd love to be able to set thumbnail size. By default they are tiny, especially on a high resolution screen -- at least to me. Thus, I'd like to be able to increase the size of thumbnails -- maybe even on-the-go but not necessarily.
Would that be possible?
Thanks,
Rasmus
Arch x64 on Thinkpad X200s/W530
Offline
I've got a quick question/feature request. I didn't find it earlier in the thread, but admittedly I only skimmed through it. I am using v.0.8.1 from the community repo.
I'd love to be able to set thumbnail size. By default they are tiny, especially on a high resolution screen -- at least to me. Thus, I'd like to be able to increase the size of thumbnails -- maybe even on-the-go but not necessarily.
Would that be possible?
It's possible but not on-the-go. You have to recompile the package from ABS, overwriting the THUMB_SIZE macro in config.h. If you use thumbnail caching, then you might want to remove all cached thumbnails by running `rm -r ~/.sxiv/*', because they will look ugly after changing THUMB_SIZE.
Offline
I have a little problem: I can't cache thumbnails on one of my computers. I have created ~/.sxiv and it gets populated with thumbnails but the caching doesn't work. I have no such problems on the other computer. I've removed the ~/.sxiv folder, reinstalled sxiv but it still doesn't work.
Offline
I have a little problem: I can't cache thumbnails on one of my computers. I have created ~/.sxiv and it gets populated with thumbnails but the caching doesn't work. I have no such problems on the other computer. I've removed the ~/.sxiv folder, reinstalled sxiv but it still doesn't work.
sxiv loads a cached thumbnail only if it has the same modification time as the image file it belongs to. Can you please check the modification times of the thumbnail cache files and compare them to the original image files? I've only tested the thumbnail caching on ext file systems, it may not work on other file systems.
Offline
'ls' reports the times to be the same. The partition is formated as ext4 and mounted with noatime and nodiratime. The other computer is using ext3 + relatime and all is fine. Switching to relatime (and regenerating thumbnail cache) didn't help.
Offline
karol, could you please use the "td" branch and post/pastebin sxivs output? Please make sure to run it without the -q flag.
Offline
karol, could you please use the "td" branch and post/pastebin sxivs output? Please make sure to run it without the -q flag.
First run, should be creating thumbnails (~/.sxiv exists and the thumbnails get created):
[karol@white inne]$ /home/karol/sxiv/sxiv -t *
sxiv: warning: [td] cache miss: 395frampol8.jpg
sxiv: warning: [td] cache miss: 4548775268_365f6043a5_o.jpg
sxiv: warning: [td] cache miss: 5383624687_2b1eeefc27_o.jpg
sxiv: warning: [td] cache miss: 561645_20031202_screen002.jpg
sxiv: warning: [td] cache miss: 5643706579_4eb5152e4a_o.jpg
sxiv: warning: [td] cache miss: 589770_20040129_screen006.jpg
sxiv: warning: [td] cache miss: 589770_20040129_screen028.jpg
sxiv: warning: [td] cache miss: 71886168884540869369.jpg
sxiv: warning: [td] cache miss: 73116647.jpg
sxiv: warning: [td] cache miss: 929240_20070530_screen043.jpg
sxiv: warning: [td] cache miss: 929240_20070530_screen048.jpg
sxiv: warning: [td] cache miss: 932650_20060508_screen001.jpg
sxiv: warning: [td] cache miss: 942290_20080303_screen011.jpg
sxiv: warning: [td] cache miss: 942291_20080122_screen024.jpg
sxiv: warning: [td] cache miss: 943566_20080910_screen002.jpg
sxiv: warning: [td] cache miss: 943567_20080711_screen013.jpg
sxiv: warning: [td] cache miss: 946232_20081031_screen001.jpg
sxiv: warning: [td] cache miss: 94707339.jpg
sxiv: warning: [td] cache miss: 950186_20100121_screen006.jpg
sxiv: warning: [td] cache miss: 952339_20090911_screen007.jpg
sxiv: warning: [td] cache miss: 954474_20090213_screen013.jpg
sxiv: warning: [td] cache miss: 954474_20090313_screen009.jpg
sxiv: warning: [td] cache miss: 954474_20090622_screen035.jpg
sxiv: warning: [td] cache miss: 954748_20081023_screen002.jpg
sxiv: warning: [td] cache miss: 959317_20100319_screen008.jpg
sxiv: warning: [td] cache miss: 959317_20100319_screen009.jpg
sxiv: warning: [td] cache miss: 995481_20101102_screen042.jpg
sxiv: warning: [td] cache miss: 996092_20100614_screen017.jpg
sxiv: warning: [td] cache miss: 997559_20110309_screen138.jpg
sxiv: warning: [td] cache miss: beyondgande_screen001.jpg
sxiv: warning: [td] cache miss: beyond_screen001.jpg
sxiv: warning: [td] cache miss: d201002_1266250433_by_serethorn_500.jpg
sxiv: warning: [td] cache miss: dsc00670y.jpg
sxiv: warning: [td] cache miss: dsc3912.jpg
sxiv: warning: [td] cache miss: dziwolagi35.jpg
sxiv: warning: [td] cache miss: GajuszJuliuszTadeusz.jpg
sxiv: warning: [td] cache miss: gr_02_14.jpg
sxiv: warning: [td] cache miss: IMG_3304-edit.jpg
sxiv: warning: [td] cache miss: img7603.jpg
sxiv: warning: [td] cache miss: Nowy-1.jpg
sxiv: warning: [td] cache miss: portmiejski029.jpg
sxiv: warning: [td] cache miss: sdc17739.jpg
sxiv: warning: [td] cache miss: sdc17752.jpg
Second run, doesn't load the cached thumbnails:
[karol@white inne]$ /home/karol/sxiv/sxiv -t *
sxiv: warning: [td] cache miss: 395frampol8.jpg
sxiv: warning: [td] cache miss: 4548775268_365f6043a5_o.jpg
sxiv: warning: [td] cache miss: 5383624687_2b1eeefc27_o.jpg
sxiv: warning: [td] cache miss: 561645_20031202_screen002.jpg
sxiv: warning: [td] cache miss: 5643706579_4eb5152e4a_o.jpg
sxiv: warning: [td] cache miss: 589770_20040129_screen006.jpg
sxiv: warning: [td] cache miss: 589770_20040129_screen028.jpg
sxiv: warning: [td] cache miss: 71886168884540869369.jpg
sxiv: warning: [td] cache miss: 73116647.jpg
sxiv: warning: [td] cache miss: 929240_20070530_screen043.jpg
sxiv: warning: [td] cache miss: 929240_20070530_screen048.jpg
sxiv: warning: [td] cache miss: 932650_20060508_screen001.jpg
sxiv: warning: [td] cache miss: 942290_20080303_screen011.jpg
sxiv: warning: [td] cache miss: 942291_20080122_screen024.jpg
sxiv: warning: [td] cache miss: 943566_20080910_screen002.jpg
sxiv: warning: [td] cache miss: 943567_20080711_screen013.jpg
sxiv: warning: [td] cache miss: 946232_20081031_screen001.jpg
sxiv: warning: [td] cache miss: 94707339.jpg
sxiv: warning: [td] cache miss: 950186_20100121_screen006.jpg
sxiv: warning: [td] cache miss: 952339_20090911_screen007.jpg
sxiv: warning: [td] cache miss: 954474_20090213_screen013.jpg
sxiv: warning: [td] cache miss: 954474_20090313_screen009.jpg
sxiv: warning: [td] cache miss: 954474_20090622_screen035.jpg
sxiv: warning: [td] cache miss: 954748_20081023_screen002.jpg
sxiv: warning: [td] cache miss: 959317_20100319_screen008.jpg
sxiv: warning: [td] cache miss: 959317_20100319_screen009.jpg
sxiv: warning: [td] cache miss: 995481_20101102_screen042.jpg
sxiv: warning: [td] cache miss: 996092_20100614_screen017.jpg
sxiv: warning: [td] cache miss: 997559_20110309_screen138.jpg
sxiv: warning: [td] cache miss: beyondgande_screen001.jpg
sxiv: warning: [td] cache miss: beyond_screen001.jpg
sxiv: warning: [td] cache miss: d201002_1266250433_by_serethorn_500.jpg
sxiv: warning: [td] cache miss: dsc00670y.jpg
sxiv: warning: [td] cache miss: dsc3912.jpg
sxiv: warning: [td] cache miss: dziwolagi35.jpg
sxiv: warning: [td] cache miss: GajuszJuliuszTadeusz.jpg
sxiv: warning: [td] cache miss: gr_02_14.jpg
sxiv: warning: [td] cache miss: IMG_3304-edit.jpg
sxiv: warning: [td] cache miss: img7603.jpg
sxiv: warning: [td] cache miss: Nowy-1.jpg
sxiv: warning: [td] cache miss: portmiejski029.jpg
sxiv: warning: [td] cache miss: sdc17739.jpg
sxiv: warning: [td] cache miss: sdc17752.jpg
This is not a big deal, I'm just reporting it doesn't work.
Offline
I think I know what's causing this. Can you please pull the "td" branch, repeat the same run and post the output as before. Thanks, karol
Offline
I've created a test dir with just a couple of pics. First run - generating thumbnails:
[karol@white cache_test]$ /home/karol/sxiv/sxiv -t *
sxiv: warning: [td] cache miss: 950186_20100121_screen006.jpg
[td] miss caused by: 1307367891 985886268 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/950186_20100121_screen006.jpg.png, 1307367891 985886268
sxiv: warning: [td] cache miss: 952339_20090911_screen007.jpg
[td] miss caused by: 1307367891 985886268 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/952339_20090911_screen007.jpg.png, 1307367891 985886268
sxiv: warning: [td] cache miss: 954474_20090213_screen013.jpg
[td] miss caused by: 1307367891 989219600 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954474_20090213_screen013.jpg.png, 1307367891 989219600
sxiv: warning: [td] cache miss: 954474_20090313_screen009.jpg
[td] miss caused by: 1307367891 992552932 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954474_20090313_screen009.jpg.png, 1307367891 992552932
sxiv: warning: [td] cache miss: 954474_20090622_screen035.jpg
[td] miss caused by: 1307367891 992552932 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954474_20090622_screen035.jpg.png, 1307367891 992552932
sxiv: warning: [td] cache miss: 954748_20081023_screen002.jpg
[td] miss caused by: 1307367891 992552932 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954748_20081023_screen002.jpg.png, 1307367891 992552932
sxiv: warning: [td] cache miss: 959317_20100319_screen008.jpg
[td] miss caused by: 1307367891 995886264 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/959317_20100319_screen008.jpg.png, 1307367891 995886264
sxiv: warning: [td] cache miss: 959317_20100319_screen009.jpg
[td] miss caused by: 1307367891 995886264 - 1307367776 909222556
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/959317_20100319_screen009.jpg.png, 1307367891 995886264
Second run, thumbnails aren't cached
[karol@white cache_test]$ /home/karol/sxiv/sxiv -t *
sxiv: warning: [td] cache miss: 950186_20100121_screen006.jpg
[td] miss caused by: 1307367891 985886268 - 1307367891 985886000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/950186_20100121_screen006.jpg.png, 1307367891 985886268
sxiv: warning: [td] cache miss: 952339_20090911_screen007.jpg
[td] miss caused by: 1307367891 985886268 - 1307367891 985886000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/952339_20090911_screen007.jpg.png, 1307367891 985886268
sxiv: warning: [td] cache miss: 954474_20090213_screen013.jpg
[td] miss caused by: 1307367891 989219600 - 1307367891 989219000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954474_20090213_screen013.jpg.png, 1307367891 989219600
sxiv: warning: [td] cache miss: 954474_20090313_screen009.jpg
[td] miss caused by: 1307367891 992552932 - 1307367891 992552000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954474_20090313_screen009.jpg.png, 1307367891 992552932
sxiv: warning: [td] cache miss: 954474_20090622_screen035.jpg
[td] miss caused by: 1307367891 992552932 - 1307367891 992552000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954474_20090622_screen035.jpg.png, 1307367891 992552932
sxiv: warning: [td] cache miss: 954748_20081023_screen002.jpg
[td] miss caused by: 1307367891 992552932 - 1307367891 992552000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/954748_20081023_screen002.jpg.png, 1307367891 992552932
sxiv: warning: [td] cache miss: 959317_20100319_screen008.jpg
[td] miss caused by: 1307367891 995886264 - 1307367891 995886000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/959317_20100319_screen008.jpg.png, 1307367891 995886264
sxiv: warning: [td] cache miss: 959317_20100319_screen009.jpg
[td] miss caused by: 1307367891 995886264 - 1307367891 995886000
[td] writing: /home/karol/.sxiv/home/karol/fotki/cache_test/959317_20100319_screen009.jpg.png, 1307367891 995886264
[karol@white cache_test]$
Offline
Okay, I think I've got it. Thumbnail caching should now work on ext4. Thanks karol for reporting the issue.
Last edited by ber_t (2011-06-06 14:02:04)
Offline
Yes, it works now, thanks a lot!
Offline
Great tool.
Thanks!
Offline
Is it possible to have sxiv draw the filename in the picture frame or below thumbnails? My WM is set up to not display a titlebar by default. . .
Thanks,
Rasmus
Arch x64 on Thinkpad X200s/W530
Offline
Is it possible to have sxiv draw the filename in the picture frame or below thumbnails? My WM is set up to not display a titlebar by default. . .
Sorry, but I do not want to draw strings inside the window frame.
Offline
1. Would it be possible to make sxiv work with the +/- keys on the numpad?
2. After viewing the last image in a set, could sxiv just cycle though the images instead of having an end?
Offline