Features and Options of stic-0.7/bin/simv This software moves and manages image files in JPEG or GIF format. Its main purpose is to show the images and to coordinate usual file management tasks with a picture recognition system. A list of external helper programs is displayed as appendix to this text. The program maintains a list of file addresses. A list index points to the current item which can be manipulated. At start the list is empty. It is usually filled by the program's arguments but may be extended by dialog commands as well. Arguments are commands which get executed before the dialog starts. Arguments which do not begin with a '-' character get prepended by -addfile: automatically, so they are added to the list as fileadresses. At the beginning of the dialog, the first item of the list is made current. If a file gets moved in or out a directory which contains a file with the name .imv_guarded_directory then the picture recognition system gets informed about the new address. Therefore all directories which contain files known to this system should also contain a file .imv_guarded_directory Files that are in a directory without .imv_guarded_directory are tested by the recognition system wether they may already be stored in a guarded directory. If similar files are found then they are displayed with a second viewer window. Many commands which expect arguments like filenames or shell commands perform parameter substition. This means that before execution certain text parts get replaced by values known to the program. All these special text parts begin with a $-sign. The next character decides about the kind of substitution. See a list what is replaced by what : $* the address of the current item $/ the directory part of $* with trailing '/' $& the filename part of $* $# the index number of the current item $. main directory (defined by -keyset:maindir) $- trash directory (defined by -keyset:trashdir) $~ the user's $HOME directory $0 the program's start directory (directory part of argv[0]) $| the program's process id (a number) $@ the program's TCP portnumber of -tcp_service:2:... (if any) $= -match_par:... with current settings (or empty text if not set) $(text) perform parameter substitution on text, execute the result as shell command and use the standard output of this command. $$ a single '$' character Commands usually are not toggled in but triggered by shortcut keys or sent by external frontend programs. To get a command line prompt, press the '@' key. If commands come faster than they can be processed, they get buffered and executed as soon as possible. The ESC key discards all pending commands and all those keystrokes and commands which follow the ESC immediately. Please note that a lot of special keys produce sequences with ESC and therefore cannot be used for key binding up to now. Commands are bound to single keys by option -keyset which takes a single keyset statement as parameter. See below command -keyset and the sample keyset definition. External frontend programs can connect via TCP/IP or named pipes. They may send commands and apply for notification of any output event. See below -pipe_service , -tcp_service, -add_view , -show_copy . This software itself is able to act as such a frontend program via TCP/IP. The connection may be encrypted to be secure against malicious clients or third party interference. See below -security and -tcp_client . Unencrypted, the input protocol simply consists of command lines separated by CR+LF, LF or NUL bytes. Several classes of output messages may be subscribed by -add_view . Command reference of application commands -addfile:fileaddress Append the given file address to the list and make it the current item. -addfile_list:fileaddress Read the given file and append all non-empty lines as file addresses to the list. The last added item becomes the current one. -back Make the previous list item current. -crc:listid:command:[arguments] Perform one of several actions with one of the CRC lists. There may be up to 16 lists simultaneously with arbitrary listid (e.g.: 1 , master). Each list consists of items with filename, 32-bit CRC, size (or 0) and a text which shows the source line from CSV file, SFV file or own CRC computation. Items with size 0 (i.e. from SFV file) match any item with the same CRC. If both sizes are larger than 0, then they have to be identical too. If given a listid that does not exist yet, the following commands create a new CRC list (provided there are less than 16 lists) : add , add_all, copy_from , read_list , read_list_list Some commands change the list ordering. Better sort before write_list . Commands : add Determine CRC and bytecount of the given fileaddress and add it to the CRC list. The fileadress is expected as argument. (e.g. -crc:1:add:$* ) add_all Add all items in the file list to the CRC list. No argument expected. (e.g. -crc:1:add_all: ) clear Remove the list from memory and free its slot for reuse. No arguments expected (e.g. -crc:1:clear: ). copy_from Adds all items of a second CRC list to the first one. The second listid is expected as argument. if_match Determine CRC and bytecount of the current item and execute arguments as command if the first match in the CRC list also has a matching name. if_name_mismatch like if_match but execute if the first match in the CRC list has a conflicting name. if_no_match like if_match but execute if there is no match in the CRC list. info Print name and number of items in the CRC list. If listid is * then info about all existing CRC lists is printed. No argument expected. (e.g. -crc:*:info: ) intersect Only keep those items which match items in a second CRC list. The second listid is expected as argument. name_mismatching Only keep those items which match items in a second CRC list but have different names. Upercase/lowercase differences are ignored. The second listid is expected as argument. (e.g. -crc:1:name_mismatching:master ) read_list Add the data lines from a CSV or SFV file to the CRC list. The name of the file is expected as argument. read_list_list Add the data lines from many CSV or SFV file to the CRC list. The names of these files are read line by line from a plain text file and handed over to read_list . The name of the plain text file is expected as argument. remove_doubles Only keep those items which do not match a previous item in the same list. No arguments expected. rename Rename the current item if its CRC can be found in the CRC list and eventually the given bytecount matches. The new name is taken from the CRC list. No arguments expected (e.g. -crc:1:rename: ). search Determine CRC and bytecount of the given fileaddress and try to find it in the CRC list. If a match is found the line from the CSV or SFV file is printed to stdout. The fileadress is expected as argument. (E.g. try to verify current item : -crc:1:search:$* ) show Print the lines of the CRC list to standard output. The number of printed lines may be limited by an optional argument. (e.g. -crc:1:show: or -crc:1:show:16 ) sort Sorts the CRC list according to one of the criteria : name, crc, size, comment The criterium is expected as argument. Prepend a - to obtain descending ordering. (e.g. -crc:1:sort:-size ) subtract Only keep those items which do not match items in a second CRC list. Second listid is expected as argument. write_list Write the CRC list to a new CSV or SFV file. Format and fileaddress are expected as arguments. (e.g. -crc:1:write_list:csv:/home/test/my_new.csv -crc:1:write_list:sfv:/home/test/my_new.sfv ) This command may not overwrite existing files. -crc performs parameter substition. -doubleto:directoryaddress Move the first item of the displayed similar files to the given directory. This is mainly used to replace poor versions of an image by a new and better one. Performs parameter substition. -for:[+|-]start_index:[+|-]end_index:command With each list item beginning with start_index and ending with end_index perform the given command. Abort loop on error. If end_index is smaller than start_index, then command is not performed at all. See -jump for an explanation of the [+|-]index format. The current item index is set according to the last run of command within the loop. -jpgb[:interruptible|viewer_repair] Convert the current item to old fashioned JPEG format. A quality parameter can be stored in the file .imv_jpgb_quality_value but a reasonable value is already preset at program start. The original file is preserved within the trash directory so this command does not immediately save disk space when reducing file size. If ":interruptible" is appended then the conversion command is only performed if the input queue is empty and it is killed if input becomes available during its run. Thus the current item might remain unchanged. ":viewer_repair" includes ":interruptible" with the additional constraints of the internal repairer (the one controled by -repair_icv) It will do nothing directly after -undo or directly after an attempt to repair the same list item. -jump:[+|-]index Make the list item current which has the given list index. The index may be any number larger than 0. If it is preceded by a '+' or '-' then the index is added resp. subtracted from the current index. Note: -jump:+1 may cause the program to end if -end_on:list_end is set. -list:[+|-]start_index:[+|-]end_index[:option] List the indice and addresses of the files in the range from start_index to end_index. An index may be any number larger than 0. If it is preceded by a '+' or '-' then the index is added resp. subtracted from the current index. If option is "raw" then only the file addresses are listed. If option is "count" then also the total number of files is listed. -mapper_args:arguments Predefine one or more arguments which are added to the command line of the picture recognition program. See -mapper_cmd below. This command also needs permission for service-mapper_db -mapper_cmd:mapper_command:databaseaddress:glue_character Set the shell command, the database and the glue character (e.g. ':') for calling the picture recognition system. A call will be formed by \