Davejkane / riv

Riv - The Rust Image Viewer
MIT License
99 stars 10 forks source link

Riv the Rust Image Viewer

Why riv? This project was born out of a frustration with image viewers on Mac. Generally the options are:-

Riv on the other hand runs from the command line, and accepts a path with globs in quotes (with globstar ** for recursive search). For example:-

$ riv "**/*.jpg"

Manual

Start riv with

$ riv.

As an optional second parameter you can add a path with globs.

$ riv "**/*.png"

Without any second parameter, riv will look for all images in the current directory.

Set a destination folder for moving files with the f flag. The folder will be created if it doesn't exist.

$ riv -f ~/saved_images

Set a sorting order with the s or --sort flag, case insensitive.

$ riv -s alphabetical "**/*.png"

Normal Mode Controls

Key 1 Key 2 Action
0-9 (many) Key1 of action to perform Perform the specified action many times
q Esc Quit
k/j Left/Right Previous/Next Image
i/o Up/Down Zoom in/out
r/R Rotate image clockwise/counterclockwise
H, J, K, L Shift + Up/Down/Left/Right Pan left/down/up/right
h Flip image horizontally
v Flip image vertically
b/w PageDown/PageUp Backward/Forward 10% of images
g/G Home/End First/Last Image (55G jumps to the 55th image)
m Move image to destination folder (default ./keep)
c Copy image to destination folder (default ./keep)
d Delete Move image to OS specific trash location
D Shift + Delete Delete image from its location
t Toggle information bar
f F11 Toggle fullscreen mode
? Toggle help box
z Left Click Toggle actual size vs scaled image
Z Center image
. (period) Repeat last action

Command Mode Controls

Short Long Argument Action
ng newglob Required The new glob/directory/file
? help None Toggle help box
q quit None Quit
sort Optional The method to sort by
df destfolder Required New folder to move/copy images to
m max Required New maximum number of files to view

Sorting Options

Option Description
Alphabetical Alphabetically by filename only
Date By date last modified, most recent first
Size By size, largest first
DepthFirst [Default] Ordered by farthest depth from current directory first
BreadthFirst Ordered by farthest depth from current directory last

Reverse the sorting order with r or --reverse flag

$ riv -sr date **/*.png

Set the maximum number of images to be displayed m or --max flag. 0 means infinitely many images.

$ riv -m 0 **/*.png

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You will need to install Rust and the SDL2 libraries to work with this project.

Installing

Go here for instructions on installing rust. Go here for instructions on installing SDL2.

You will also need sdl2_image and sdl2_ttf

Mac

The trash program is required for sending images to the trash.

brew install trash sdl sdl2_image sdl2_ttf

Arch

sudo pacman -S sdl2 sdl2_image sdl2_ttf

Ubuntu

sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev

Other distros

Hopefully you can figure it out from the above instructions. If you do, please make a PR for this README with the specific instructions.

After that you can build with:

cargo build

Contributing

I aim for this project to be a great place for people just starting with Rust and just starting with Open Source to get involved. I'm pretty green with Rust myself, so any code review, refactorings to idiomatic style, bug fixes and feature PRs are very much appreciated. I have purposely left some features unimplemented before open sourcing with the idea that someone can pick them up as a good first contribution. So please, join in. No developer is too green for this project.

Never made a pull request before? Check out this 5 minute video which explains a simple process. Remember to make pull requests against the development branch.

Not sure what to work on? Check out our issues.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details