1-- License and Disclaimer --
2
3This patch & script package was written by Alexey Spiridonov, and is
4licensed under the GNU GPLv2. There is NO WARRANTY.
5
6XV is copyrighted by John Bradley.
7
8-- What is this? --
9
10This is a small patch for XV that allows you to run scripts by pressing
11a key from F1 through F12 (or more, just change 12 to your number in the
12patch file).
13
14The patch enables a number of useful features. Here is a my set-up:
15
16F1: Losslessly rotate JPEG 90 degrees to the right.
17F2: Losslessly rotate JPEG 90 degrees to the left.
18
19F3: Print the current selection rectangle (on the terminal where xv was
20    launched). This is useful for quickly recording a bunch of positions in
21    an image. Use case:
22      I'm annotating face positions.
23        1) Select Joe in picture, hit F3, type "Joe" in the terminal.
24        2) Select Jane in the picture, ...
25        ...
26        n) Copy the text visible in the terminal, and paste it into the
27           JPEG comment.
28    Of course, i would write a more convenient script if I annotated faces
29    with any any frequency.
30
31F4: Edit JPEG comment (I use it for annotations/tags).
32
33F5: Log a 'losslessly rotate right' command for batch processing.  This
34    writes the rotation command for the current file into a shell script
35    somewhere ("~/photos/bin/rotscript" by default). This is great for
36    slower computers because you don't have to wait for each image to
37    rotate; instead, you just rotate them all at once by running the
38    resulting script.
39F6: Log a 'losslessly rotate left' batch command.
40
41F8: Crop image on disk, but back-up the uncropped version. You can make
42    a succession of crops this way, with a backup made at every step.
43    This wastes disk space, so be sure to clean up once you get a crop you
44    like.
45F7: Undo the last crop done on this image. This can be repeated until you're
46    back at the original.
47
48-- Installation --
49
50I'll tell you how to get the set-up I described above. Of course, you can
51customize it to your heart's content.
52
53(( 1 ))
54
55Go to:
56
57  http://www.sonic.net/~roelofs/greg_xv.html
58
59and follow the XV install instructions there. If you are okay with
60reading shell scripts, you might also give this a shot:
61
62  http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/media-gfx/xv/xv-3.10a-r12.ebuild
63
64When you're ready to type "make install", do the following to apply my patch:
65
66  $ cd WHEREVER_YOU_COMPILED_XV
67  $ patch -p1 --dry-run < PATH/TO/xv-3.10a-fkey-command-patch.greg-xv
68
69Hopefully, the above command won't complain; if it does, Greg Roelofs
70probably changed his patchset, and my patch has become out of date -- let me
71know. If that went well, run:
72
73  $ patch -p1 < PATH/TO/xv-3.10a-fkey-command-patch.greg-xv
74
75Now, simply recompile and install as described in the other instructions.
76
77(( 2 ))
78
79Copy 'jpegcrop.sh', 'jpegeditcom.sh', 'jpegundocrop.sh', 'jpegrot.sh',
80'jpeglogrot.sh' to some convenient directory.
81
82Suggestions: ~/photos/bin, /usr/local/bin, etc...
83
84Edit 'jpeglogrot.sh' and 'jpegeditcom.sh'. In the former, you need to
85customize the path to 'jpegrot.sh'. In the latter, you should make set
86your favorite editor. The spots to customize are marked as such.
87
88(( 3 ))
89
90Open .Xdefaults in your favorite text editor, and paste the following lines
91there:
92
93xv.F1command: ~/photos/bin/jpegrot.sh 90 %s
94xv.F2command: ~/photos/bin/jpegrot.sh 270 %s
95xv.F3command: @echo "The selection rect for '%s' is at (%d, %d) of size %dx%d."
96xv.F4command: @~/photos/bin/jpegeditcom.sh %s &
97xv.F5command: @~/photos/bin/jpeglogrot.sh 90 %s
98xv.F6command: @~/photos/bin/jpeglogrot.sh 270 %s
99xv.F7command: ~/photos/bin/jpegundocrop.sh %s
100xv.F8command: ~/photos/bin/jpegcrop.sh %s %d %d %d %d
101
102Change '~/photos/bin/' to the directory you chose in (( 2 )). In case you're
103wondering what the '@' symbol means, it tells XV not to reload the file
104after running this command. The default is to reload the file.
105
106-- Apologies --
107
108I didn't get a chance to run through the above instructions and check
109that they work. I know they're right in spirit, but I might've made a typo
110or two. Even if it's obvious to you, would you please let me know by writing
111to lesha at mit dot edu?
112