1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
|
|
2 | |
|
|
3 | use Cwd (); |
|
|
4 | use Encode (); |
|
|
5 | use File::Glob (); |
2 | |
6 | |
3 | use Gtk2 -init; |
7 | use Gtk2 -init; |
4 | use Gtk2::Gdk::Keysyms; |
8 | use Gtk2::Gdk::Keysyms; |
5 | |
9 | |
|
|
10 | use Gtk2::CV; |
|
|
11 | |
6 | use Gtk2::CV::ImageWindow; |
12 | use Gtk2::CV::ImageWindow; |
7 | use Gtk2::CV::Schnauzer; |
13 | use Gtk2::CV::Schnauzer; |
8 | |
14 | |
9 | $VERSION = 0.1; |
15 | BEGIN { |
|
|
16 | require Gtk2::CV::Plugin; |
|
|
17 | require "$ENV{HOME}/.cvrc" if -r "$ENV{HOME}/.cvrc"; |
|
|
18 | } |
10 | |
19 | |
|
|
20 | use Gtk2::CV::Plugin::NameCluster; |
|
|
21 | use Gtk2::CV::Plugin::RCluster; |
|
|
22 | |
|
|
23 | Gtk2::Rc->parse (Gtk2::CV::find_rcfile "gtkrc"); |
|
|
24 | |
|
|
25 | use File::Spec; |
|
|
26 | |
|
|
27 | my $mainwin; |
11 | my $viewer; |
28 | my $viewer; |
|
|
29 | my $viewer_count; |
|
|
30 | my $schnauzer; |
|
|
31 | my $info; |
|
|
32 | my $help; |
12 | |
33 | |
13 | package cluster; |
34 | my $schnauzer_idx = 0; |
14 | |
35 | |
15 | use Glib::Object::Subclass Gtk2::Window; |
36 | sub new_schnauzer { |
|
|
37 | my $s = new Gtk2::CV::Schnauzer; |
16 | |
38 | |
17 | use Gtk2::SimpleList; |
39 | $s->signal_connect_after (key_press_event => \&std_keys); |
18 | |
40 | $s->signal_connect (activate => sub { |
19 | sub INIT_INSTANCE { |
41 | my $label = sprintf "%s (%d)", |
20 | my ($self) = @_; |
42 | (File::Spec->splitpath ($_[1]))[2], |
21 | |
43 | -s $_[1]; |
22 | $self->set_default_size (600, 400); |
44 | $info->set_label ($label); |
23 | |
45 | $viewer->load_image ($_[1]) if $viewer; # TODO: error, or chose ANY viewer |
24 | my $vbox = new Gtk2::VBox; |
|
|
25 | $self->add ($vbox); |
|
|
26 | |
|
|
27 | my $box = new Gtk2::HBox; |
|
|
28 | $vbox->add ($box); |
|
|
29 | $box->add (my $sw = new Gtk2::ScrolledWindow); |
|
|
30 | $sw->add ( |
|
|
31 | $self->{list} = new Gtk2::SimpleList |
|
|
32 | "#" => "int", |
|
|
33 | "Name" => "text", |
|
|
34 | ); |
|
|
35 | |
|
|
36 | $box->add ($self->{schnauzer} = new Gtk2::CV::Schnauzer); |
|
|
37 | |
|
|
38 | $self->{list}->get_column(0)->set_sort_column_id(0); |
|
|
39 | $self->{list}->get_column(1)->set_sort_column_id(1); |
|
|
40 | |
|
|
41 | $self->{list}->signal_connect (cursor_changed => sub { |
|
|
42 | my $row = scalar +($_[0]->get_selection->get_selected_rows)[0]->get_indices; |
|
|
43 | |
|
|
44 | my $k = $_[0]{data}[$row][1]; |
|
|
45 | $k = $self->{cluster}{$k}; |
|
|
46 | |
|
|
47 | $self->{schnauzer}->set_files ( |
|
|
48 | [sort map "$self->{path}/$_", @{$k->[1]}], |
|
|
49 | ); |
|
|
50 | |
|
|
51 | 1; |
|
|
52 | |
|
|
53 | }); |
46 | }); |
54 | } |
|
|
55 | |
47 | |
56 | sub analyse { |
48 | Gtk2::CV::Plugin->call (new_schnauzer => $s); |
57 | my ($self, $path) = @_; |
|
|
58 | |
49 | |
59 | opendir my $dir, $path |
50 | $s |
60 | or die "$path: $!"; |
51 | } |
61 | |
52 | |
62 | $self->{path} = $path; |
53 | sub new_viewer { |
|
|
54 | my $self = new Gtk2::CV::ImageWindow; |
63 | |
55 | |
64 | my @files = map { |
56 | $viewer_count++; |
65 | my $str = $_; |
|
|
66 | $str =~ s/[\-_ ]+/ /g; |
|
|
67 | $str =~ s/\.[^\.]+//g; |
|
|
68 | [$str, $_] |
|
|
69 | } |
|
|
70 | grep !/\.(sfv|crc|par|par2)$/, readdir $dir; |
|
|
71 | |
57 | |
72 | my %cluster; |
58 | $self->set_title ("CV: Image"); |
73 | |
59 | |
74 | my @regexps = ( |
60 | $self->signal_connect (key_press_event => sub { |
75 | [qr<\d+$>, qr<^(.+?)\ *(\d+)$>], |
61 | $viewer = $_[0]; |
76 | [qr<\ \d+$>, qr<^(.+?)(\d+)\ +(\d+)$>], |
|
|
77 | ); |
|
|
78 | |
62 | |
79 | for my $info (@regexps) { |
63 | my $key = $_[1]->keyval; |
80 | my $re = $info->[0]; |
64 | my $state = $_[1]->state; |
81 | for (@files) { |
65 | |
82 | if ($_->[0] =~ $re && $_->[0] =~ $info->[1]) { |
66 | if ($state * "control-mask" && $key == $Gtk2::Gdk::Keysyms{c}) { |
83 | push @{ ($cluster{$1} ||= [ $info, []])->[1] }, $_->[1]; |
67 | my $viewer = new_viewer (); |
|
|
68 | $viewer->set_image ($_[0]->{image}); |
|
|
69 | $viewer->show_all; |
84 | } |
70 | 1 |
|
|
71 | } else { |
|
|
72 | &std_keys |
|
|
73 | or $schnauzer->signal_emit (key_press_event => $_[1]) |
85 | } |
74 | } |
86 | } |
|
|
87 | |
|
|
88 | $self->{cluster} = \%cluster; |
|
|
89 | |
|
|
90 | while (my ($k, $v) = each %cluster) { |
|
|
91 | my $n = scalar @{$v->[1]}; |
|
|
92 | push @{$self->{list}{data}}, [$n, $k] if $n > 2; |
|
|
93 | } |
|
|
94 | } |
|
|
95 | |
|
|
96 | package main; |
|
|
97 | |
|
|
98 | sub new_schnauzer { |
|
|
99 | my $w = new Gtk2::Window; |
|
|
100 | $w->add (my $s = new Gtk2::CV::Schnauzer); |
|
|
101 | |
|
|
102 | $s->signal_connect (activate => sub { |
|
|
103 | $viewer->load_image ($_[1]); |
|
|
104 | }); |
75 | }); |
105 | $s->signal_connect (key_press_event => \&std_keys); |
|
|
106 | $w->signal_connect (delete_event => sub { $_[0]->destroy }); |
76 | $self->signal_connect (delete_event => sub { $_[0]->destroy; 0 }); |
107 | $s->signal_connect (destroy => sub { %{$_[0]} = () }); |
77 | $self->signal_connect (destroy => sub { |
|
|
78 | $viewer = undef if $viewer == $_[0]; |
108 | |
79 | |
109 | $s->set_dir ("/root/pix"); |
80 | main_quit Gtk2 unless --$viewer_count; |
110 | $w->show_all; |
|
|
111 | |
81 | |
112 | $w; |
82 | 0 |
|
|
83 | }); |
|
|
84 | |
|
|
85 | $self->signal_connect (button3_press_event => sub { |
|
|
86 | $mainwin->visible |
|
|
87 | ? $mainwin->hide |
|
|
88 | : $mainwin->show_all; |
|
|
89 | |
|
|
90 | 1 |
|
|
91 | }); |
|
|
92 | |
|
|
93 | Gtk2::CV::Plugin->call (new_imagewindow => $self); |
|
|
94 | |
|
|
95 | $self |
113 | } |
96 | } |
114 | |
97 | |
115 | sub std_keys { |
98 | sub std_keys { |
116 | my $key = $_[1]->keyval; |
99 | my $key = $_[1]->keyval; |
|
|
100 | my $state = $_[1]->state; |
117 | |
101 | |
118 | my $ctrl = grep $_ eq "control-mask", @{$_[1]->state}; |
102 | my $ctrl = $state * "control-mask"; |
119 | |
103 | |
120 | if ($key == $Gtk2::Gdk::Keysyms{q}) { |
104 | if ($key == $Gtk2::Gdk::Keysyms{q}) { |
121 | main_quit Gtk2; |
105 | $viewer->destroy; |
122 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { |
106 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { |
123 | new_schnauzer; |
107 | my $w = new Gtk2::Window; |
|
|
108 | |
|
|
109 | $w->set_role ("schnauzer"); |
|
|
110 | $w->set_title ("CV: Schnauzer"); |
|
|
111 | $w->add (my $s = new_schnauzer); |
|
|
112 | $s->set_dir (File::Spec->curdir); |
|
|
113 | $s->set_geometry_hints; |
|
|
114 | $w->show_all; |
|
|
115 | |
|
|
116 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { |
|
|
117 | unless ($help) { |
|
|
118 | require Gtk2::Ex::PodViewer; |
|
|
119 | |
|
|
120 | $help = new Gtk2::Window; |
|
|
121 | $help->set_role ("help"); |
|
|
122 | $help->set_title ("CV: Help"); |
|
|
123 | $help->set_default_size (500, 300); |
|
|
124 | $help->signal_connect (delete_event => sub { $help->hide; 1 }); |
|
|
125 | |
|
|
126 | $help->add (my $sw = new Gtk2::ScrolledWindow); |
|
|
127 | $sw->add (my $h = new Gtk2::Ex::PodViewer); |
|
|
128 | |
|
|
129 | #binmode DATA, ":utf8"; |
|
|
130 | $h->load_string (do { local $/; <DATA> }); |
|
|
131 | } |
|
|
132 | |
|
|
133 | $help->show_all; |
124 | } else { |
134 | } else { |
125 | return 0; |
135 | return 0; |
126 | } |
136 | } |
127 | |
137 | |
128 | 1; |
138 | 1 |
129 | } |
139 | } |
130 | |
140 | |
131 | $viewer = new Gtk2::CV::ImageWindow; |
141 | { |
132 | $viewer->signal_connect (key_press_event => \&std_keys); |
142 | $viewer = new_viewer; |
|
|
143 | $::cur_viewer = $viewer; |
|
|
144 | |
|
|
145 | $schnauzer = new_schnauzer; |
|
|
146 | |
|
|
147 | $mainwin = new Gtk2::Window; |
|
|
148 | $mainwin->set_role ("main"); |
|
|
149 | $mainwin->set_title ("CV"); |
|
|
150 | $mainwin->add (my $vbox = new Gtk2::VBox); |
133 | $viewer->signal_connect (delete_event => sub { main_quit Gtk2 }); |
151 | $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 }); |
|
|
152 | |
|
|
153 | $vbox->add ($schnauzer); |
|
|
154 | $vbox->pack_end (my $frame = new Gtk2::Frame, 0, 0, 0); |
|
|
155 | $frame->add (my $hbox = new Gtk2::HBox 0, 0); |
|
|
156 | $hbox->pack_start ((new Gtk2::Label "Info: "), 0, 0, 0); |
|
|
157 | $hbox->pack_end (my $labelwindow = new Gtk2::EventBox, 1, 1, 0); |
|
|
158 | $labelwindow->add ($info = new Gtk2::Label); |
|
|
159 | $labelwindow->signal_connect_after (size_request => sub { $_[1]->width (0); 0 }); |
|
|
160 | $info->set (selectable => 1, xalign => 0, justify => "left"); |
|
|
161 | |
|
|
162 | $schnauzer->set_geometry_hints; |
|
|
163 | } |
|
|
164 | |
|
|
165 | if (@ARGV) { |
|
|
166 | my $show_first = sub { |
|
|
167 | $schnauzer->show_all; |
|
|
168 | $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); |
134 | $viewer->show_all; |
169 | $viewer->show_all; |
|
|
170 | }; |
135 | |
171 | |
136 | my $cluster = new cluster; |
172 | if (@ARGV == 1 && $ARGV[0] eq "-0r") { |
137 | |
173 | local $/; |
138 | $cluster->analyse ("/fs/samsung/store-anime-done"); |
174 | $schnauzer->set_paths ([split /\x00/, <STDIN>], 1, $show_first); |
139 | $cluster->show_all; |
175 | } elsif (@ARGV == 1 && -d $ARGV[0]) { |
140 | |
176 | $schnauzer->set_dir (shift, $show_first); |
141 | #$viewer->set (path => "/fs/samsung/store-anime-done/yuumi_kazuaki_-_love_to_hajieki_to_sayonara_to_-_150.jpg"); |
177 | } else { |
142 | #$viewer->set (path => "/root/pix/kvvz.jpg"); |
178 | if ($ARGV[0] eq "-g") { |
|
|
179 | shift @ARGV; |
|
|
180 | @ARGV = map +(File::Glob::bsd_glob $_, File::Glob::GLOB_BRACE | File::Glob::GLOB_QUOTE), @ARGV; |
|
|
181 | } |
|
|
182 | $schnauzer->set_paths ([@ARGV], 1, $show_first); |
|
|
183 | } |
|
|
184 | } else { |
|
|
185 | $schnauzer->set_dir (File::Spec->curdir, sub { |
|
|
186 | $mainwin->show_all; |
|
|
187 | $viewer->show_all; |
|
|
188 | }); |
|
|
189 | } |
143 | |
190 | |
144 | main Gtk2; |
191 | main Gtk2; |
145 | |
192 | |
|
|
193 | Gtk2::CV::flush_aio; |
146 | |
194 | |
|
|
195 | __DATA__ |
|
|
196 | |
|
|
197 | =encoding utf-8 |
|
|
198 | |
|
|
199 | =head1 NAME |
|
|
200 | |
|
|
201 | cv - a fast gtk+ image viewer loosely modeled after XV |
|
|
202 | |
|
|
203 | =head1 SYNOPSIS |
|
|
204 | |
|
|
205 | cv [file...] |
|
|
206 | |
|
|
207 | =head1 FEATURES |
|
|
208 | |
|
|
209 | CV is supposed to work similar to the venerable XV image viewer, just |
|
|
210 | faster. Why faster? |
|
|
211 | |
|
|
212 | =over 4 |
|
|
213 | |
|
|
214 | =item * optimized directory scanning algorithm |
|
|
215 | |
|
|
216 | The directory scanning in CV uses some tricks that - on most modern |
|
|
217 | filesystems - makes it possible to detect filetypes faster than stat()'ing |
|
|
218 | every file. This makes CV suitable for directories with lots of files |
|
|
219 | (10000+). |
|
|
220 | |
|
|
221 | This algorithm is quite unprecise - it doesn't make a difference between |
|
|
222 | files, device nodes, symlinks and the like, and filetype detection is done |
|
|
223 | using the file extension only. |
|
|
224 | |
|
|
225 | On the positive side, it is usually many orders of magnitude faster than |
|
|
226 | traditional scanning techniques (good for directories with 10000 or |
|
|
227 | 100000+ files). |
|
|
228 | |
|
|
229 | =item * queuing for all time-consuming background tasks |
|
|
230 | |
|
|
231 | All tasks, such as unlinking files or generating thumbnails, that can be |
|
|
232 | done in the background will be done so - no waiting required, even when |
|
|
233 | changing directories. |
|
|
234 | |
|
|
235 | =item * use of asynchronous I/O |
|
|
236 | |
|
|
237 | CV tries to use asynchronous I/O whereever it makes sense, for example |
|
|
238 | while scanning directories, waiting for stat data, unlinking files or |
|
|
239 | generating thumbnails. This usually decreases scanning times for large |
|
|
240 | directories a bit (especially on RAID devices and over NFS) and makes CV |
|
|
241 | much more interactive. |
|
|
242 | |
|
|
243 | =item * fast image loading |
|
|
244 | |
|
|
245 | The time span between the user issuing a command and displaying the new |
|
|
246 | image should be as small as possible. CV uses optimized (especially |
|
|
247 | for JPEG) loading functions and sacrifices some quality (e.g no gamma |
|
|
248 | correction, although this might change) to achieve this speed. |
|
|
249 | |
|
|
250 | =item * fast thumbnail creation |
|
|
251 | |
|
|
252 | Thumbnail creation uses both CPU and Disk-I/O. CV interleaves both, so |
|
|
253 | on modern CPUs, thumbnailing is usually limited by I/O speed. Thumbnail |
|
|
254 | creation for JPEGs has been specially optimized and can even take |
|
|
255 | advantage of multiple CPUs. |
|
|
256 | |
|
|
257 | =item * minimum optical clutter |
|
|
258 | |
|
|
259 | CV has no menus or other user interface elements that take up a lot of |
|
|
260 | screen space (or are useful for beginning users). The schnauzer windows |
|
|
261 | can also be somewhat crowded. |
|
|
262 | |
|
|
263 | The point of an image viewer is viewing images, not a nice GUI. This is |
|
|
264 | similar to XV's behaviour. |
|
|
265 | |
|
|
266 | =item * efficient (and hard to learn) user interface |
|
|
267 | |
|
|
268 | CV uses key combinations. A lot. If you are an experienced XV user, you |
|
|
269 | will find most of these keys familiar. If not, CV might be hard to use at |
|
|
270 | first, but will be an efficient tool later. |
|
|
271 | |
|
|
272 | =item * multi-window GUI |
|
|
273 | |
|
|
274 | CV doesn't force you to use a specific layout, instead it relies on your |
|
|
275 | window manager, thus enabling you to chose whatever layout that suits you |
|
|
276 | most. |
|
|
277 | |
|
|
278 | =item * i18n'ed filename handling throughout |
|
|
279 | |
|
|
280 | As long as glib can recognize your filename encoding (either UTF-8 or |
|
|
281 | locale-specific, depending on the setting of G_BROKEN_FILENAMES) and you |
|
|
282 | have the relevant fonts, CV will display your filenames correctly. |
|
|
283 | |
|
|
284 | =item * extensible through plug-ins |
|
|
285 | |
|
|
286 | I have weird plug-ins that access remote databases to find a |
|
|
287 | directory. This is not likely to be of any use to other people. Likewise, |
|
|
288 | others might have weird requirements I cannot dream of. |
|
|
289 | |
|
|
290 | =item * filename clustering |
|
|
291 | |
|
|
292 | Among the standard plug-ins is a filename clustering plug-in, that (in |
|
|
293 | case of tens of thousands images in one directory) might be able to |
|
|
294 | cluster similar names together. |
|
|
295 | |
|
|
296 | =back |
|
|
297 | |
|
|
298 | =head1 DESCRIPTION |
|
|
299 | |
|
|
300 | =head2 THE IMAGE WINDOW |
|
|
301 | |
|
|
302 | You can use the following keys in the image window: |
|
|
303 | |
|
|
304 | q quit the program |
|
|
305 | < half the image size |
|
|
306 | > double the image size |
|
|
307 | , shrink the image by 10% |
|
|
308 | . enlarge the image by 10% |
|
|
309 | n reset to normal size |
|
|
310 | m maximize to screensize |
|
|
311 | M maximize to screensize, respecting image aspect |
|
|
312 | ctrl-m toggle maxpect-always mode |
|
|
313 | ctrl-sift-m toggle using current image size as max image size |
|
|
314 | u uncrop |
|
|
315 | r set scaling mode to 'nearest' (fastest) |
|
|
316 | s set scaling mode to 'bilinear' (default) |
|
|
317 | shift-s set scaling mode to 'hyper' (slowest) |
|
|
318 | t rotate clockwise 90° |
|
|
319 | T rotate counterclockwise° |
|
|
320 | a apply all rotations loslessly to a jpeg file (using exiftran) |
|
|
321 | ctrl-v open a new visual schnauzer window for the current dir |
|
|
322 | ctrl-c clone the current image window |
|
|
323 | ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image |
|
|
324 | ctrl-p fire up the print dialog |
|
|
325 | escape cancel a crop action |
|
|
326 | |
|
|
327 | And when playing movies, these additional keys are active: |
|
|
328 | |
|
|
329 | left rewind by 10 seconds |
|
|
330 | right forward by 10 seconds |
|
|
331 | down rewind by 60 seconds |
|
|
332 | up forward by 60 seconds |
|
|
333 | pg_up rewind by 600 seconds |
|
|
334 | pg_down forward by 600 seconds |
|
|
335 | o toggle on-screen display |
|
|
336 | p pause/unpause |
|
|
337 | escape stop playing |
|
|
338 | 9 turn volume down |
|
|
339 | 0 turn volume up |
|
|
340 | |
|
|
341 | Any other keys will be sent to the default schnauzer window, which can be |
|
|
342 | toggled on and off by right-clicking into the image window. |
|
|
343 | |
|
|
344 | Left-clicking into the image window will let you crop the image (usually |
|
|
345 | to zoom into large images that CV scales down). |
|
|
346 | |
|
|
347 | =head2 THE VISUAL SCHNAUZER |
|
|
348 | |
|
|
349 | Any image-loading action in a schnauzer window acts on the |
|
|
350 | "last-recently-activated" imagewindow, which currently is simply the last |
|
|
351 | image window that received a keypress. |
|
|
352 | |
|
|
353 | You can use the following keys in the schnauzer window: |
|
|
354 | |
|
|
355 | ctrl-space, |
|
|
356 | space move to and display next image |
|
|
357 | ctrl-backspace, |
|
|
358 | backspace move to and display previous image |
|
|
359 | ctrl-return, |
|
|
360 | return display selected picture, or enter directory |
|
|
361 | |
|
|
362 | cursor keys move selection |
|
|
363 | page-up move one page up |
|
|
364 | page-down move one page down |
|
|
365 | home move to first file |
|
|
366 | end move to last file |
|
|
367 | |
|
|
368 | ctrl-a select all files |
|
|
369 | ctrl-shift-a select all files currently displayed in the schnauzer window |
|
|
370 | ctrl-d delete selected files WITHOUT ASKING AGAIN |
|
|
371 | ctrl-g force generation of thumbnais for the selected files |
|
|
372 | ctrl-s rescan current direcory or files updates/deletes etc. |
|
|
373 | ctrl-u update selected (or all) icons if neccessary |
|
|
374 | ctrl-l don't use, will become a plug-in eventually |
|
|
375 | |
|
|
376 | ^ go to parent directory (caret). |
|
|
377 | |
|
|
378 | 0-9, |
|
|
379 | a-z find the first filename beginning with this letter |
|
|
380 | |
|
|
381 | Right-clicking into the schnauzer window displays a pop-up menu with |
|
|
382 | additional actions. |
|
|
383 | |
|
|
384 | =head3 SELECTION |
|
|
385 | |
|
|
386 | You can select entries in the Schnauzer in a variety of ways: |
|
|
387 | |
|
|
388 | =over 4 |
|
|
389 | |
|
|
390 | =item Keyboard |
|
|
391 | |
|
|
392 | Moving the cursor with the keyboard will first deselect all files and then |
|
|
393 | select the file you moved to. |
|
|
394 | |
|
|
395 | =item Clicking |
|
|
396 | |
|
|
397 | Clicking on an entry will select the one you clicked and deselect all |
|
|
398 | others. |
|
|
399 | |
|
|
400 | =item Shift-Clicking |
|
|
401 | |
|
|
402 | Shift-clicking will toggle the selection on the entry under the mouse. |
|
|
403 | |
|
|
404 | =item Dragging |
|
|
405 | |
|
|
406 | Dragging will select all entries between the one selected when pushing the |
|
|
407 | button and the one selected when releasing the button. If you move above |
|
|
408 | or below the schnauzer area while drag-selecting, the schnauzer will move |
|
|
409 | up/down one row twice per second. In addition, horizontal mouse movement |
|
|
410 | acts as a kind of invisible horizontal scrollbar. |
|
|
411 | |
|
|
412 | =item Hint: double-click works while click-selecting |
|
|
413 | |
|
|
414 | You can double-click any image while click-selecting to display it |
|
|
415 | without stopping the selection process. This will act as if you normally |
|
|
416 | double-clicked the image to display it, and will toggle the selection |
|
|
417 | twice, resulting in no change. |
|
|
418 | |
|
|
419 | =back |
|
|
420 | |
|
|
421 | =head1 FILES |
|
|
422 | |
|
|
423 | When starting, CV runs the F<.cvrc> file in your F<$HOME> directory as if |
|
|
424 | it were a perl script. in that, you will mostly load plug-ins. |
|
|
425 | |
|
|
426 | Example: |
|
|
427 | |
|
|
428 | system "fping -q -t 10 ether" |
|
|
429 | or require "/fs/cv/cvplugin.pl"; |
|
|
430 | |
|
|
431 | This will load a plug-in, but only if the machine I<ether> is reachable |
|
|
432 | (supposedly the plug-in is networked in some way :). |
|
|
433 | |
|
|
434 | =head1 ENVIRONMENT |
|
|
435 | |
|
|
436 | =over 4 |
|
|
437 | |
|
|
438 | =item CV_EDITOR |
|
|
439 | |
|
|
440 | The program that gets executed when the user presses C<CTRL-e> in the |
|
|
441 | Schnauzer or image window. The default is C<gimp>. |
|
|
442 | |
|
|
443 | =item CV_AUDIO_PLAYER |
|
|
444 | |
|
|
445 | Program used to play all sorts of audio (wav, aif, mp3, ogg...), default "play". |
|
|
446 | Will be called like C<< $CV_AUDIO_PLAYER -- <path> >>. |
|
|
447 | |
|
|
448 | =item CV_PRINT_DESTINATION |
|
|
449 | |
|
|
450 | The default (perl-style) destination to use in the print dialog. |
|
|
451 | |
|
|
452 | =item CV_TRASHCAN |
|
|
453 | |
|
|
454 | When set, must point to a directory where all files that are deleted are |
|
|
455 | moved to. If unset, files that are deleted are really being deleted. |
|
|
456 | |
|
|
457 | =back |
|
|
458 | |
|
|
459 | =head1 SECURITY CONSIDERATIONS |
|
|
460 | |
|
|
461 | CV uses Pixbuf to load non-JPEG images. Pixbuf is not considered safe for |
|
|
462 | this purpose, though (from the gtk-2.2 release notes): |
|
|
463 | |
|
|
464 | "While efforts have been made to make gdk-pixbuf robust against invalid |
|
|
465 | images, using gdk-pixbuf to load untrusted data is not recommended, due to |
|
|
466 | the likelyhood that there are additional problems where an invalid image |
|
|
467 | could cause gdk-pixbuf to crash or worse." |
|
|
468 | |
|
|
469 | =head1 BUGS/TODO |
|
|
470 | |
|
|
471 | Lots of functionality is missing. |
|
|
472 | |
|
|
473 | Pixbuf doesn't always honor G_BROKEN_FILENAMES, so accessing files with |
|
|
474 | names incompatible with utf-8 might fail. |
|
|
475 | |
|
|
476 | rotate on disk |
|
|
477 | lots of ui issues |
|
|
478 | save(?) |
|
|
479 | preferences |
|
|
480 | |
|
|
481 | =head1 AUTHOR |
|
|
482 | |
|
|
483 | Marc Lehmann <cv@plan9.de>. |
|
|
484 | |
|
|
485 | =cut |
|
|
486 | |