You are not logged in.

#501 2016-07-04 12:33:18

progandy
Member
Registered: 2012-05-17
Posts: 5,180

Re: sxiv - Simple image viewer written in C

drtebi wrote:

That is why I used the `tr` command... I am not sure if I could achieve the same without?

Yes, it is possible, for example:

find . -type f -iname '*.jpg' -not -iname '*.lzn.*' | sxiv -i

Last edited by progandy (2016-07-04 12:34:18)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#502 2016-07-04 13:40:08

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: sxiv - Simple image viewer written in C

Doh. Yeah, -i 's the way to go (and in case it's not clear from progandy's example, the criteria for find can be arbitrarily complex, using -not, -or and parentheses to built as complex conditionals as you need)

Offline

#503 2016-07-04 22:40:28

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: sxiv - Simple image viewer written in C

Thanks again. I can see it was definitely worth posting here ☺

I really need to study the man pages a bit more to end up with the most simple and fastest command line... I didn't know about the `-i` option of sxiv either.

My final line now is:

find . -type f -iname '*.jpg' -not -iname '*.lzn.*' | sxiv -ifbt

But now I wonder if any kind of sorting could be implemented... most of my file organization is like so:

YYYY/YYYY-MM-DD - <camera> - <text>/<camera>-<roll>-<img-no>.jpg

(I shoot mostly film and use a few different cameras, in case you wonder about "roll" and "camera".)

`find` and `sxiv` don't have a sorting option as far as I can see, so piping the find output through sort would be the only option:

find . -type f -iname '*.jpg' -not -iname '*.lzn.*' | sort | sxiv -ifbt

That works...

I already wrote a little script that allows me to just view images of a certain camera; I think I will expand on that to include displaying images from a certain year.

OK, enough of that, not sure if this is the right place to discuss these kinds of scripts, which are not 100% sxiv related.

Offline

#504 2017-02-21 00:40:34

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: sxiv - Simple image viewer written in C

Just out of curiosity: Why does sxiv use it's own cache directory and mechanism for thumbnails, as opposed to what is recommended by freedesktop.org?

I am not complaining... just wondering.

Offline

#505 2022-04-14 16:02:33

cj6xu6ru
Member
Registered: 2022-04-14
Posts: 1

Re: sxiv - Simple image viewer written in C

Hi,

I have a newbie question here.
I cannot get sxiv to open jp2 files.

When I use sxiv in the command line to open jp2 files I get the following:

sxiv: ./Downloads/509893-Color In Business, Science And Industry_jp2/509893-Color In Business, Science And Industry_0425.jp2: Error opening image
sxiv: no more files to display, aborting


thanks

Offline

#506 2022-04-14 18:36:08

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: sxiv - Simple image viewer written in C

cj6xu6ru wrote:

Hi,

I have a newbie question here.
I cannot get sxiv to open jp2 files.

When I use sxiv in the command line to open jp2 files I get the following:

sxiv: ./Downloads/509893-Color In Business, Science And Industry_jp2/509893-Color In Business, Science And Industry_0425.jp2: Error opening image
sxiv: no more files to display, aborting


thanks

just to check: Did you not use quotes around the file path? If not, try:

sxiv "./Downloads/509893-Color In Business, Science And Industry_jp2/509893-Color In Business, Science And Industry_0425.jp2"

Offline

#507 2022-04-14 20:08:23

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: sxiv - Simple image viewer written in C

cj6xu6ru wrote:

Hi,

I have a newbie question here.
I cannot get sxiv to open jp2 files.

When I use sxiv in the command line to open jp2 files I get the following:

sxiv: ./Downloads/509893-Color In Business, Science And Industry_jp2/509893-Color In Business, Science And Industry_0425.jp2: Error opening image
sxiv: no more files to display, aborting


thanks

Actually, it looks like sxiv doesn't support jp2 files. You would need to convert the files to another format first to view them with sxiv. For example, you can install imagemagick:

sudo pacman -S imagemagick

And then convert the file with its convert script (note the "jpg" extension in the second argument):

convert "509893-Color In Business, Science And Industry_0425.jp2" "509893-Color In Business, Science And Industry_0425.jpg"

And then open the jpg result with sxiv:

sxiv "509893-Color In Business, Science And Industry_0425.jpg"

'hope that helps!

Offline

#508 2023-02-22 08:39:02

newt9
Member
Registered: 2021-02-14
Posts: 14

Re: sxiv - Simple image viewer written in C

Has anyone got a script to reload the current image set after renaming an image?

My use case is typically to open a directory with images in sxiv, and then to rename using the following key-handler script:

"w")
	name="$(dmenu -p "Rename $file to: ")" 2> /dev/null
	ext="$(echo "$file" | sed -r "s/^.*\.(.*\$)/\L\1/" | dmenu -p "Use extension as: ")"
	if ! [ -z "$name" ]; then
		mv "$file" "$(dirname $file)/$name.$ext"
	fi ;;

This removes the image from the set (no longer visible in thumbnails). If I add a & before the ;;, it keeps the image there, but under the old name. This is especially a problem if I want to re-rename it (made a mistake), as the above script wouldn't find the new file name.

I'm wondering if anyone has implemented a solution where it reloads the directory (or set of images I'd loaded in with the original command) under its new name.

Offline

Board footer

Powered by FluxBB