-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsdl_img.1
195 lines (176 loc) · 8.82 KB
/
sdl_img.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
.\" Man page for SDL_IMG
.TH SDL_IMG 1 "22 December 2023" "1.0" "The SDL2 and stb_image based image viewer"
.\" Please adjust this date when revising the manpage.
.\"
.SH "NAME"
sdl_img \- A simple but unique image viewer based on stb_image and SDL2
.SH "SYNOPSIS"
.B ./sdl_img [-f] [-R] [-s [delay]] [-r dir] [-l text_list] [files/dirs]
.B ./sdl_img image1.jpg (will open all images in same dir)
.B ./sdl_img -l list_of_imgs (urls or local paths or both)
.B ./sdl_img . (will open all images in .)
.B ./sdl_img image1.jpg somedir/* otherdir/image2.png
.B ./sdl_img -l list1 example.com/image.jpg -l list3 -r ~/somedir
Not all of the options are listed here; see below for the remainder.
.SH "DESCRIPTION"
\fBsdl_img\fR is designed to be a simple, easy to use image viewer that
implements some unique features while still having a short (~5000 SLOC not
including libraries) simple codebase. It handles all the normal functions of an
image viewer (browsing through directories, zoom, pan, rotate, delete, slideshow).
.TS
l l .
| Basic Controls | Description |
| --------------------|-------------|
| Left (or Up) | Previous image(s) or pan if appropriate |
| Right (or Down) | Next image(s) or pan if appropriate |
| Space | Next image(s) |
| CTRL+Space | Previous image(s) |
| CTRL + Direction | Next or previous image(s) even when zoomed in |
| +/- | Zoom in/out |
| Mouse Wheel | Zoom in/out |
| Left click + drag | Pan around a zoomed in image |
| A | Actual size |
| F | Toggle fill screen mode |
| Home | Go to first image in the list |
| M | Shuffle (Mix) the images (only in single mode) |
| N | Sort the images by file name (only in single mode) |
| CTRL+N | Sort the images by file path (only in single mode) |
| Z | Sort the images by size (only in single mode) |
| T | Sort the images by last modified (only in single mode) |
| CTRL + F or F11 | Toggle Fullscreen |
| ESC | Exit or "Back" similar to Android |
| L/R | Rotate the current image left/right |
| H/V | Flip the current image horizontally/vertically |
| Delete | Delete the current image and move to the next (only in single mode) |
| Backspace | Remove the current image and move to the next (only in single mode) |
| CTRL + 1 | Single image mode |
| CTRL + 2 | Double image mode |
| CTRL + 4 | Quad image mode |
| CTRL + 8 | 8 image mode |
| CTRL + U | Thumbnail mode |
| CTRL + I | List mode |
| F1 - F10 | Start a slideshow with 1 - 10 second delay |
.TE
For GIFS there are extra controls, though the progress bar is only
displayed if you are viewing a GIF in single image mode:
.TS
l l .
| GIF Controls | Description |
| -------------------- |-------------|
| CTRL + +/- | Speed up or slow down an animated gif |
| CTRL + Mouse Wheel | Speed up or slow down an animated gif |
| P | Pause/Unpause gif |
| Mouse over progress bar | Pause |
| Wheel over progress bar | Scroll through frames |
| click/drag progress bar | select/scroll frames |
.TE
The most obvious unique features are the multi-image modes but others include the
extra GIF features, the vim inspired thumbnail mode, the list mode, shuffle/sort etc.
Within each image mode the basic controls work on all images simultaneously
unless a specific image is selected by hitting 1-n and then they operate only
on that image, ie cycling, zooming, fit will only effect that image.
To return to "all at once" mode, hit 0.
By default, when you hit next/prev in n-image mode, it will display the n sequential
images immediately after the nth image or before the 1st image. This is annoying if
you're trying to compare a sequence of tuples that aren't interleaved when sorted. For
example if you have files abc01.jpg, abc02.jpg,... and xyz01.jpg, xyz02.jpg..., all of
the former would sort first. If you wanted to compare abcX with xyzX in 2-image mode
every time you hit next, you'd go from [abcX,xyzX] to [xyzX+1,xyzX+2]. To solve this
you can go to preferences and select the toggle "Preserve relative offsets in multimode
movement" which would lead to [abcX,xyzX] to [abcX+1,xyzX+1] behavior. I'm open to
a better name/description ("Independent movement mode"?) and to making that the default
behavior.
Switching from a lower to a higher mode will load images to the right of the last image
currently viewed. Switching from a higher to a lower will show the first n images
of the higher mode where n is the lower number. An exception is if you have an
image selected and go to single mode, that is the image that will be used.
The slideshow feature is smart enough to wait long enough to finish any gif being
displayed even if that takes longer than the specificed delay. ESC ends the slideshow.
All other controls work while in slideshow mode, meaning starting a slideshow does not
automatically toggle to fullscreen, it will run in double, quad or oct-image mode, or
even on a single image selected within those modes.
Something to note about the rotation functionality is that while it will rotate any
image, it will only ask whether you're sure you want to save single frame images because
stb_image_write does not support gifs at all, let alone animated gifs. It will try to
detect the type from the extension and output that type if possible, otherwise jpg is
the default.
.SS Vim Inspired Thumb Mode
Switch with CTRL+U to viewing all your current images as thumbnails on a vertically
scrolling plane. Animated GIF thumbnails are generated from the first frame.
You can use the arrows and mouse and scrollwheel to move around
and select an image but if you're a vim user you'll feel right at home.
.TS
l l .
| Thumbmode Controls | Description |
| -------------------- |-------------|
| Arrow Keys or HJKL | Move around |
| Mouse Wheel | Move up and down |
| Click | Move to that image |
| Enter or Double Click | Change to normal mode on current image |
| CTRL + HJKL | Adjust the number of rows and columns shown |
| Backspace or R | Removes current selection from the list |
| X | Removes and possibly Deletes current selection |
| CTRL + Backspace/R/X | Invert action (remove/delete unselected items) |
| / | Start typing a search |
| /pattern + ENTER | Enter "Results mode" (cycle with n/N) |
| CTRL + ENTER | (in results mode) View results |
| ESC | Exit or "Back" similar to Android |
.TE
The number of rows and columns can also be set in Preferences, as well as whether X deletes
instead of just removing the selection.
.SS List Mode
Switch with CTRL+I to view a list of all your current images with columns showing the size
and last modified time. You can select the column headings to sort by that ascending or
descending. You can scroll through the list or use up and down. Hitting Enter or double
clicking will go back to normal mode on that image.
Type something in the search bar at the top and hit enter to show a list of files that match.
Same controls as normal list mode, but if you hit enter or double click you will be in "View
Results" mode, which is normal mode but only viewing the results (same as from thumb search).
ESC to backs out of View Results, Results, and list mode entirely.
.PP
.SH "OPTIONS"
.TP
\fBfilename/directory(s)...\fR
Specifies the image to open when \fBsdl_img\fR starts. If a directory is given
it is scanned for images. \fBsdl_img\fR also supports handling of remote files.
.TP
\fB\-f, \-\-fullscreen\fR
Start \fBsdl_img\fR in fullscreen mode.
.TP
\fB\-s, \-\-slide-show [delay=3]\fR
Open in slideshow mode.
.TP
\fB\-r, \-\-recursive dir\fR
Scan dir recursively for images to add to the list
.TP
\fB\-R\fR
Scan all directories that come after recursively (-r after -R is redundant).
You can mix them, with -r and non -r dirs before -R but you might as well
move the -r dirs after -R to make your life easier.
.TP
\fB\-c, \-\-cache ./your_cache\fR
Use specified directory as cache.
.TP
\fB-v, \-\-version\fR
Output version information and exit.
.TP
\fB\-h, \-\-help\fR
Print standard command line options.
.P
.SH "EXAMPLES"
\fBsdl_img \-f http://mate-desktop.org/assets/img/icons/mate.png\fR
.RS 4
Open the referenced file in fullscreen mode.
.RE
.PP
\fBsdl_img \-s /usr/share/eom/icons/hicolor/scalable/actions\fR
.RS 4
Open the images in the referenced directory in slideshow mode.
.SH "BUGS"
.SS Should you encounter any bugs, they may be reported at:
http://github.com/rswinkle/sdl_img/issues
.SH "AUTHORS"
Robert Winkler <[email protected]>
.SH "SEE ALSO"
.SS
More information can be found at http://github.com/rswinkle/sdl_img