No Bull Moose version 0.2
A utility for batch converting progressive JPEGs to baseline JPEGs losslessly
Copyright (C) 2007-2008 Jeffrey P. (AKA Archaemic)
========================================
Table of Contents
I.	Usage
     a. Setup
     b. Invoking
     c. Compiling
II.	Known bugs and caveats
III.	History
IV.	Miscellany
========================================
I.		Usage
========================================
     a. Setup
----------------------------------------

The progam comes already setup so that it can be used for Windows or Mac. Simply
extract the directory that corresponds to your operating system.

If you're on Linux, you must find a working copy of jpegtran. On Ubuntu and
Debian, you must install the libjpeg-progs package to get jpegtran. On Gentoo,
Fedora/Red Hat and Slackware, jpegtran comes with the (lib)jpeg package.

----------------------------------------
     b.	Invoking
----------------------------------------

Unlike with v0.1, No Bull Moose must now be invoked from a command line. This is
for safety reasons. To get a command line, go to Start > Run and enter cmd (on
Windows), Macintosh HD > Applications > Utilities > Terminal (on Mac OS X), or
one of many different ways that you should know if you are on a Unix-like system
Please note that this program must be compiled on your own if you wish to use it
on any other Unix-like system (such as *BSD). Once you have obtained a command
line, navigate your way to the directory in which you extracted No Bull Moose
using the "cd" command (e.g., cd /PSP/nbm if you extracted the program to the
folder C:/PSP/nbm/), then type nbm [directory] (or ./nbm if you're on a
Unix-like system) where directory is the directory containing the files that you
want to convert (typically you want just a period/full stop) and hit enter to
begin converting all of the JPEGs in the directory specified, in the ZIPs and
RARs in that directory, and the same in all subdirectories. Note that if
jpegtran is not installed into the path, as it may not be on a Mac, the program
should be invoked by entering the following:

	PATH=.:$PATH ./nbm [directory]

The program has two command line options, specified by following a hyphen (-)
with a number from 0 to 9, indicating the level of compression, and/or i, which
edits the JPEGs in place, instead of outputing into the output directory. ZIPs,
RARs, CBZs and CBRs are extracted into a temporary directory and then
recompressed into a ZIP that is placed in the output directory. Please note that
if two ZIPs or RARs have the same filename, only one will show up in the output
directory.

Further details on the invocation syntax:
nbm [-i#] file [...]

Convert all the files specified to baseline JPEGs. If the filename does not end
with .jpg, .jpeg, .jpe, .zip, .rar, .cbz or .cbr, the file is ignored. If the
file is actually a directory, the directory is searched and converted
recursively. There is currently no option for a non-recursive invocation. As of
version 0.2, a file must be specified for safety. If the file is an archive, the
archive is extracted into ./temp, JPEGs are converted, and then files are placed
back into a ZIP in ./output directory. RAR compression is not now supported, nor
will ever be supported. If the # option (a number from 0 to 9) is specified,
this level of compression is used for the ZIP. Otherwise, it is not compressed.
A compression level of 0 means no compression. If the i option is specified,
files are modified in place and backups are created. Archive editing in place is
not currently supported. All options must be specified in one token.

----------------------------------------
      c. Compiling
----------------------------------------

Before compiling No Bull Moose, you must first compile libunrar.a for your
operating system.  To compile libunrar.a, you can download the source
(unrarsrc-3.x.x.tar.gz) from ftp://ftp.rarlab.com/rar or
http://www.rarlab.com/rar/. Depending on which operating system, what to do with
the source differs. You must first patch the makefile to allow you to build the
library statically, and patches are provided with the source code of No Bull
Moose for Unix and Windows.

To apply the patch to the makefile and then build on Unix, use the following
commands (replacing the path where appropriate):

	patch makefile.unix /path/to/nbm/src/unrar/makefile.unix.patch
	make -f makefile.unix a

To compile libunrar on Mac, apply the following commands in the terminal to the
source (if you do not want to or cannot make a universal binary, omit the
UNVERSAL=1 portion of the command):

	patch makefile.unix /path/to/nbm/src/unrar/makefile.unix.patch
	UNIVERSAL=1 make -f makefile.unix a

On Windows, you must be using MinGW and MSYS to apply the patch to the makefile.
To do so, open MSYS and change the directory to where you unarchived the source
of UnRAR and apply the following commands:

	patch makefile.cygmin /path/to/nbm/src/unrar/makefile.cygwin.patch
	make -f makefile.cygmin

Then copy the libunrar.a file to the src directory of No Bull Moose. Then type
the following commands to compile No Bull Moose if you are on Linux:

	make && sudo make install

If you plan to run the application in place, use these command instead:

	make
	chmod +x nbm

If you wish to compile this application as a Universal Binary (Macs only), you
should use execute the makefile as such:

	make universal

If you are on Windows, you must use this command instead:

	make windows

========================================
II.	Known bugs and caveats
========================================

There are currently a few minor bugs and/or caveats that are known in No Bull
Moose.

- Archives with contain files or folders with leading or trailing whitespace
  are not handled properly under Windows. Please extract such archives manually
  and run the program from there.
- Directories created by No Bull Moose are not deleted when the program finishes
  executing, even if the files in the folders have all been deleted.
- Command line options must be specified together in one token and be before the
  input files.

========================================
III.	History
========================================

v0.2 (2008-01-10)
- [Feature] Added support for ZIP and RAR archives
- [Feature] Output directory for out of place converting
- [Feature] Full 64-bit support on Macs
- [Bugfix] Filenames with $, \ and " are now supported
- [Bugfix] Fixed potential stack overflow in to_baseline function

v0.1 (2007-08-25)
- Initial release

========================================
IV.		Miscellany
========================================

- This program is distributed with IJG JPEG library DLL for Windows, builds of
  jpegtran for Windows and Mac and the minizip library, all of which are free
  software.
