Copyright © Glenn Linderman 2006 — First public release Nov 14, 2006

Documentation for DRC

DRC is Glenn's Digital Recorder and Camera helper program.

Purpose: to perform a variety of operations on Digital Recorder and Camera memory cards, and to perform directory and file manipulations that are generally found useful for files produced by Digital Recorders and Cameras.

This file is obtained by using the --help option.

What's new in DRC

2007/12/05 version enhancements:

Definitions

Some definitions are in order, because DRC deals with a variety of devices, each of which use their own terminology for similar concepts. This document is written in terms of broader concepts, rather than more specific ones for a particular device.

device or recording device
used to include cameras, digital wallets, and voice recorders
recording
used to include pictures, videos, and audio files
media
used to refer to storage on which the device makes recordings. It could memory built in to a particular device, or it could be removable media such as a flash memory card of any of the many varieties that exist, a recordable CD, a portable hard drive, or magnetic tape.
reader
used to refer to the recording device itself, when connected to the computer by a cable of some sort, or to a separate component that can read and write removable media from some devices, or may be a component built in to the computer (CD drive, card slot, etc.)
id
defines some characteristic of a group of recordings. For pictures and video, it could be the initials of the photographer, for example.

Common Practices

Generally, to save wear and tear on the batteries of the recording device, it is better to remove the media from the device, and use a reader to access the recordings. If the device has an A/C power adapter, a separate reader is not as important. If a separate reader is used, the software that comes with the device is generally not needed, or if the device is used, perhaps only a device driver is needed, rather than the whole suite of low-function software that generally comes with cheaper devices. It is quite possible that DRC, IrfanView, and Audacity (all free downloads), will have all the capabilities needed, except for video processing.

When copying files from the media, the files are also renamed to the form YYYYMMDD-HHMMSSid.*, where the uppercase letters are replaced by the date and time the recording was made, and the id is intended to reflect the person who made the recording (photographer, in the case of a camera). This form easily allows recordings from devices with synchronized clocks to be interspersed in time sequence for convenient playback. (The timestamps can also be synchronized after the fact, by clever renaming of the files, if the difference in times between the devices can be determined, either by looking at both devices after the fact, or knowing that certain recordings were made at the same time by both devices.)

Supported Devices

The following table is a list of supported devices, classified by their primary use (although some devices are multi-use). It is fairly straight-forward to add support for other devices not in this list, given a copy of the file structure of the device, with examples of each type of special feature used.

Digital Voice RecorderTested models
OlympusDS-2300, DS-3300 (unchanged folder names)
ZoomH2
CameraTested models
Concord eye Duo 2000 (set camera into DSC mode)
Note: camera has no internal clock, so the current date and a sequence number is used instead.
CanonA40, Digital Rebel, Powershot SD100
CasioEX-Z750
Fuji2650
KodakDC210, DX3215, DX4530
Konica MinoltaDiMAGE X1 (see also Minolta)
MinoltaDiMAGE Xi, DiMAGE Xt (see also Konica Minolta)
Nikon900, 950, 990, 995, 4500, D1X, D40X
OlympusCammedia D560
PanasonicLumix FZ10, DSC-TZ3
PentaxOptio S, Optio S5i, Optio S7
SonyDSC-P50
VivitarVivicam 2800
Digital WalletTested models
Minds@WorkDigital Wallet, MindStor 1700, MindStor 1800

It is best if the device has an internal clock, set to the proper time, then the files can be properly timestamped, and used in the filename. For cameras, the camera can insert the time taken into the picture file, and that internal timestamp can be used for the name of the picture. The internal timestamp is actually more accurate than the one placed into the file system, since the FAT filesystem only supports time accuracy to the nearest even second.

Devices without internal clocks can be supported, but the program assumes the recordings were made on the date the files are being processed, and applies a sequence number in lieu of a timestamp.

Digital wallets are field devices used copy a memory card to a hard disk, CD-R, or CD-RW, to free up space on the card, without needing to carry a computer for that purpose. They basically make a new directory for each card copied, and copy the complete contents of the card into that directory. With flash cards available in the multi-gigabyte range these days, and cheap enough to have several, the usefulness of wallets has diminished, but if you estimate you make exceed the capacity of your available flash cards, it is an option to consider.

Devices other than those listed, especially by the same manufacturers, which are likely to use the same file structures, may also work. If you test one, and it works, let me know and I'll add it to the list of tested models. If it doesn't work, send me a sample file structure, and I may add support for it.

Options

The table below contains a list of all the legal options for DRC with descriptions of their use. Some options take parameters, which are named in the Parameter column. Some options are action commands, indicated with an A in the A column, and others are parameters. Some options, indicated with an M in the M column, may be used multiple times in the same command invocation.

If no action option is given on the command line, DRC will attempt to self-install.

Option Parameter A M Description
‑h A M Display basic help text on the console window if one exists; overrides all other actions defined below.
‑‑debug M Specify a debug level by the number of instances of this parameter.
‑‑help A M Display this help message in a browser windows, overrides all other actions defined below.
‑‑topic helptopic Choose a particular help topic to display, in conjunction with ‑‑help. Unknown topics display the general help. There is a helptopic for each menu name, plus the following list of topics: command, definitions, practices, devices, options, menu, WEdir, WEfile, advanced
‑‑about A M Show a dialog box with the version (which is the date released).
‑‑menu menu_name A Option for producing a menu with a choice of other sets of options. During installation, an icon is installed on the Windows Desktop, in the Window Start Menu, and in the Quick Launch toolbar which uses this option.
‑‑noexif Specify that the files should be renamed to use the filesystem "last modified timestamp" from the source file. The default behavior is to use the EXIF timestamp from files that have such, or the EXIF timestamp of the related image file (if there is a related image file, and the relationship can be inferred), using the filesystem timestamp only if none other can be found, or if this option is specified.
‑‑drive letter: M Specify the drive letter of the media to search. Can specify more than one, if appropriate. Default is to search all drive letters from A: through Z:.
‑‑addendum text Specify text to add to the file name when adjusted. Default: _4email
‑‑noaddendum Specify that the default addendum text should not be used. If ‑‑addendum is also explicitly specified, that text is used.
‑‑quality factor Specify a number between 30 and 100 for the default JPEG quality factor. Default: 40 (30 is marginal quality, 40 is OK, 95 is superb)
‑‑height pixels Specify the new maximum height for the image. Default: 480
‑‑width pixels Specify the new maximum width for the image. Default: 640
‑‑dir directory Specify the directory of operations. This is where the files from the device are to be placed, and in which files to be renamed are located. For wallets, a subdirectory for each media image is created here, and used for operations in turn. Default is the current directory (useful when used from the command prompt). Overrides the current directory for other options that use a current directory.
‑‑askdir Specify that a directory should be chosen dynamically by the user. Overrides ‑‑dir. Default is from ‑‑dir parameter.
‑‑file file Specify a file to operate on. This is mostly useful in conjunction with ‑‑menu frename: or with ‑‑menu file:. Overrides ‑‑dir and ‑‑askdir.
‑‑askfile Specify that a file should be chosen via a browsing dialog. Overrides ‑‑dir and ‑‑askdir. Default is from the ‑‑file parameter.
‑‑askid Specify that the user should choose the id dynamically. A list of known ids is provided. Default is no id. See also ‑‑id.
‑‑topid Set the default id to the top one in the list of known ids. Default is no id. Overrides ‑‑askid, unless there are no known ids, in which case it is synonymous with ‑‑askid. See also ‑‑id.
‑‑id id Set the default id for this operation. Overrides ‑‑askid and ‑‑topid. Default is no id.

The id can be used in some renaming operations as an extra component in the resulting file name(s). It can be used to indicate the photographer or some other useful bit of information that should be applied to groups of recordings.
‑‑copy A Copy digital recordings from the recording device or media card to the current directory, and give an option to rename them to the form YYYYMMDD‑HHMMSSid.*
‑‑clean A Clean digital recordings from the recording device or media card. Done after ‑‑copy if it was also specified.
‑‑explore A Launch IrfanView (preferred, if found) or Windows Explorer on the specified directory. Done after ‑‑copy or ‑‑clean if either or both were also specified.
‑‑install A Install, or re-install. Renames any prior drc_ini.txt file, and creates a new one. If no options are given on the command line, an upgrade install is performed, which uses the current drc_ini.txt file, creating a new one only if there wasn't one already. If ‑‑install is given, it supercedes all other command line actions, overwrites the current drc_ini.txt, and exits when complete.

Available Menus

Menu NameLink to description
icon: Menu for Desktop Shortcut and Start/ Programs
file: Menu for file oriented operations
filerename: Menu for file renaming
run: Menu for invoking programs on files
dir: Menu for directory oriented operations
dirrename: Menu for bulk renaming
convert: Menu for bulk image file conversions

Menu for Desktop Shortcut and Start/ Programs

DRC commands for the icon include 3 options for copying digital recordings from Digital Recorder or Camera cards, initiating the menu for directory oriented operations and bulk renaming and determining the version of DRC.

The first four options all first prompt for a directory in which to work. For the copy commands, it should be the destination directory, where you wish the files

The 3 options for copying recordings have a lot in common: all will search each active drive letter on the computer to discover file systems that match the structure of all the configured Digital Recorders or Cameras, and copy from those file systems all the recorded information to the chosen directory, renaming them using their internal or file timestamps along the way.

This means that to copy recordings from a reader using this feature, you connect the reader to the computer, and then, ignoring any popup explorer windows that XP might provide, you click the DRC icon on the Desktop, choose one of the copy commands, and browse to the proper directory using the folder browser that appears.

All three copy commands share using the ‑‑copy, ‑‑clean, and ‑‑explore options of the DRC command line to do their work. You will be prompted for confirmation of the "copy & rename" step and for the "delete from original media" step. IrfanView (if it was installed before DRC) or Windows Explorer will be opened to allow exploration of the directory containing the newly copied files.

The three copy commands differ with respect to the photographer id. One automatically choose the default photographer id. The second asks the user to choose a photographer id. The third simply omits the photographer id.

Menu for file oriented operations

This menu includes options to invoke three sub-menus: Menu for file renaming, Menu for invoking programs on files, Menu for directory oriented operations.

The next option is for copying the fully qualified pathname of the file to the Clipboard as a text entity.

The next options are to browse the containing directory with Windows Explorer, or with IrfanView thumbnails mode (if IrfanView was installed before DRC).

The next three options are related to emailing files. The first will resize a picture file in any format to a 640x480 JPEG file, and invoke MAPI to compose an email. The second will compose but not resize, and the third will resize but not compose. Various combinations then can prepare several files for emailing in a single message; all but one would have to be added to the email attachment list manually. The resized files get '_email' added to their name to indicate their smaller size.

The next four options do specific picture file format conversions. The first converts a picture to bitonal black and white line art, which is only appropriate if it is made of text or line art in the first place. Bitonal black and white means exactly two colors, not grey scale (which is what so-called black and white photographs actually are). The second converts to LZW compressed TIFF, which is a lossless format. The third and fourth convert to high and medium quality JPEG. It should be noted that quality is never improved by conversion to JPEG.

Menu for file renaming

This menu allows a file to be renamed in a variety of ways. The potential names are precalculated, and presented in the menu, so if one of them looks to be appropriate, simply choose the menu item with the appropriate name.

Menu for invoking programs on files

This menu allows a file to be opened with a variety of other programs. The selection of programs is dependent on programs DRC understands, and that were installed prior to DRC being installed. If you find an interesting program listed, simply choose the menu item for that program. Not all programs are appropriate for all files.

Menu for directory oriented operations

This menu has commands to process directories, mostly meaning all the files within the directory.

The first option is a menu for bulk renaming, and the second is a Menu for bulk image file conversions.

The third option is to copy the directory name to the Clipboard as a text entity.

The next options are to browse the directory with Windows Explorer, or with IrfanView thumbnails mode (if IrfanView was installed before DRC).

Menu for bulk renaming

This menu allows a directory of files to be renamed according to various rules. The list of old and new names will be displayed before the renames are performed. It would be wise to review the list carefully. The renames will be attempted in the order presented, but if there are naming conflicts resulting from the rules, not all renames may be successful.

The first three rules are to replace the root name of the file with a timestamp. If the file is an image file and contains an internal timestamp, that is the timestamp used; otherwise the filesystem last-modified timestamp is used, under the assumption that it is hopefully the one assigned by the recording device when the recording was made. In addition, the second and third rules add an id after the timetamp.

The fourth rule attempts to fix files that were renamed by using incorrect timestamps, under the assumption that the internal timestamp is more accurate. However, the original filesystem timestamp may have been more accurate than the current one, so if there is no internal timestamp, this may be a regression. Use this option with caution, on selected files only.

The fifth and sixth rules add an id to the end of the filename's root.

The last rule renames all uppercase and mixed case extensions to lowercase.

Menu for bulk image file conversions

The four options do specific image file format conversions to all the files in the directory. If the input files would have the same extension as the output files, the output files may be overwritten. If some files are not image files, errors may result.

The first option converts a picture to bitonal black and white line art, which is only appropriate if it is made of text or line art in the first place. Bitonal black and white means exactly two colors, not grey scale (which is what so-called black and white photographs actually are). The second option converts to LZW compressed TIFF, which is a lossless format. The third and fourth convert to high and medium quality JPEG. It should be noted that quality is never improved by conversion to JPEG.

Explorer extensions for directories

DRC commands for directories include 3 options for copying digital recordings from Digital Recorder or Camera cards, initiating the menu for directory oriented operations and bulk renaming, and starting a command prompt with the chosen directory as the current working directory.

The 3 options for copying digital recordingss have a lot in common: all will search each active drive letter on the computer to discover file systems that match the structure of all the configured Digital Recorders or Cameras, and copy from those file systems all the recorded information to the chosen directory, renaming them using their internal or file timestamps along the way.

This means that to copy digital recordings from a reader using this feature, you connect the reader to the computer, and then, ignoring any popup explorer windows that XP might provide, you choose the destination location in Windows Explorer, right click on the destination directory (also knowns as a folder), and choose the appropriate DRC copy command.

All three copy commands share using the ‑‑copy and ‑‑clean options of the DRC command line to do their work. You will be prompted for confirmation of the "copy & rename" step and for the "delete from original media" step.

The three copy commands differ with respect to the photographer id. One automatically choose the default photographer id. The second asks the user to choose a photographer id. The third simply omits the photographer id.

Explorer extensions for files

DRC commands for files include 3 entries all of which open submenus. The first is a menu for file oriented operations, which contains a large collection of options, including the next two that are available here. The second is a menu for file renaming, and the third is a Menu for invoking programs on files.

Advanced configuration options

Integrate with Irfan View

You can integrate DRC into Irfan View as follows: Start Irfan View, choose the "Options / Properties" menu, and the "Misc. 2" tab within the resulting Properties dialog. In the box labeled "Set external viewer/editor", click the "Browse" button and find where you installed DRC (possibly "C:\Program Files\Glenn\drc.exe"), or type in the path to where it is installed. Once you have the path, add after it to configure Irfan View to launch the DRC menu for file oriented operations. You might end up with something like this in the box:

"C:\Program Files\Glenn\drc.exe" --menu file: --file

Making a shortcut to always copy to a particular directory.

Right-click on the drc_menu shortcut, and drag it to another spot on the Desktop, and choose "Copy here" from the pop-up menu. If desired, rename the shortcut to something like "DRC to newrecords". Then right-click the shortcut, and choose Properties. In the "Shortcut" tab, the text in the Target box should look something like

"c:\Program Files\Glenn\drc.exe" --menu icon:
Remove the "--menu icon:" part, and add in other text, to make it look like
"c:\Program Files\Glenn\drc.exe"  --copy --clean --explore --topid --dir f:\newpics
or you can choose more or fewer options per the above documentation. These particular options will copy (if confirmed) the recordings from your media to the directory specified ("f:\newpics" in the example), using the top configured id in the new names, delete (if confirmed) the recordings from your media, and open a Windows Explorer or Irfan View Thumbnails to view the results.

Once a shortcut with appropriate parameters is created, it can be moved or copied into Quick Launch, the Start Menu tree, or whereever else Windows lets you put a shortcut.

Removing unwanted Windows Explorer context menu entries

If some of the context menu entries configured by DRC are unwanted, they can be individually removed by following the instructions in the following file. Download and save the file, and open it with a text editor, and follow the instructions. Here is the file. Keep your revised version for use after installing newer versions of DRC.

Uninstall DRC completely

If you wish to completely uninstall DRC, download this batch file and run it. Then delete drc.exe from whereever you installed it. Finally, remove any specialty shortcuts you made.

Relocate par-cache

The PAR facility used to pack DRC into a self-installing executable needs a temporary directory for unpacking things. By default, this is placed in your Windows TEMP directory. You can control the placement of these temporary directories, for DRC and other PAR packed executables, by configuring a system environment variable PAR_GLOBAL_TMPDIR which contains the name of an existing directory which you wish to use instead. Do not use the directory in which DRC.exe resides, but one at a lower level would work, or somewhere under the %APPDATA% directory would work.

Environment variables are configured in the Advanced tab of the System Control Panel.

More to be documented

Check the version of this page on the web to see additional advanced tips as they are documented.

Offer suggestions

If you have a suggestion for improving this program, other than regarding performance, I'm always glad to hear about it. I know the program is slow, that is because it is written in a scripting language, but that scripting language enabled me to write it effectively. I'm a lone programmer, however, with lots of projects, so unless the suggestion excites me, I may not get to it. I already have a wish list started for enhancements to DRC. Make your suggestions via this web page.