LIBJPEG.A
DATE : 02/03/98
AUTHOR : Eric Vannier
VERSION : 1.03


This document describes the libjpeg.a library for djgpp and allegro 2.2
(wipsep21 and upper) and upper. I actually use v3.0, but it works with
the older wip versions.

#include <std_disclaimer.h>

   "I do not accept responsibility for any effects, adverse or otherwise, 
    that this code may have on you, your computer, your sanity, your dog, 
    and anything else that you can think of. Use it at your own risk."


Introduction :
------------
This library is based upon the IJG code. This code was designed
for reading, writing with multiple options jpeg files.
My work consisted in porting the existing code for djgpp and Allegro.
If you want further information on IJG read the README file.

Features :
--------
Reads and writes jpeg files. The user do not have to worry about
color conversion, since 8 (colormapped mode), 15/16, 24, 32 bits
are supported for input (for writing) and output (for reading).
This means that this will convert your jpeg file (which 24 bits)
to a 8 bits output if needed.
This library allows the user to set parameters with the XXX_ex
functions.
Documentation for these functions are included in the header file.
Note that many other features were added and are explained in the
changes file. Please report to this file for further information.


Copyright :
---------
Please remember that this a port of the IJG work for Allegro.
Therefore, the IJG restrictions apply for this code. For copyright
information about IJG read the README file.
This special package is swap-ware.
You may use, modify, redistribute, and generally hack it about in
any way you like.
If you decide to distribute a program made with this library, you should
send me (see end of the file for address information) something : just
mentionning my name in the credits, and notifying me by email is perfect.
If you intend to make money with it, please be sure I am warned of it, and
I agree with it : in this case, this is very recommended to send me something
such as money or a new hard drive, or whatever you want :). I trust you ;-)

Installing :
----------
Before doing anything, you should make sure that you have the correct
version of Allegro, since I use the 16, 24 ... bits abilities which were
not implemented in the 2.2 version. This works with the 2.2 WIPsep21
version and upper. To get the latest version of Allegro (3.0 at this point) :
http://www.talula.demon.co.uk/allegro/
When, Allegro has been properly compiled and installed you are ready to
install this library :
 - unzip this package. Do not forget the -d option. I guess you have already
 done that since you are reading this file :) 
 - go to the directory which was created. You may wish to use PGCC instead
 of the classic gcc to get speed improvements. If so, uncomment PGCC=true at
 the beginning of the makefile. Please note it assumes you have properly
 installed PGCC.
 - type make. This will compile the libjpeg.a library and copy it in your
 lib directory. This will also copy the jpeg.h header file in your include
 directory.
 - You may want to compile the example program. To do so, type make test.
 This will compile the sample.c program. You will be able to run it with
 sample.exe (no args). This program reads the sample.dat (which is basically
 a jpeg file !) and displays it with various options. See the code of sample
 for further info.
 - You are done !

Using this library :
------------------
add
#include <jpeg.h>
in the file where you intend to use the jpeg libray.
Then compile with the
gcc foo.c -o foo.exe -lalleg -ljpeg
There is an example program in the root directory.
You'll further information on how to use this library in this file (sample.c)
and in the include file (jpeg.h). You can compile this program by typing
make test
If you still have problems, you can reach me by mail (see below). I usually
answer all my mails, so do not hesitate :)
 

Note for PGCC users :
-------------------
You have to change the makefile (as explained earlier) to take advantage of
the new optimisations flags of PGCC.
A few warnings will be issued during compilation with some PGCC versions.
These warnings should be ignored.
I personnaly do not use PGCC since it did not prove to be pretty stable.
But this is a matter of taste :) I may change my mind in the future.

Troubleshooting :
---------------
 - "I tried to make an program whith LIBJPEG, and it returned :
   undefined reference to load_jpeg_ex"
   Make sure you have linked libjpeg.a with your program.
 - "I tried tp make a program whith LIBJPEG, and it returned :
   undefined reference to makecol"
   Make sure you have linked Allegro and LibJpeg in an appropriate way.
   The old doc was erronous (corrected in v1.03).
   gcc -o sample.exe -ljpeg -lalleg sample.c
 - "I cannot run the sample program : it exits whithout displaying anything"
   Use the commandline options to change the video options (run sample -h).
   If the problem persists whith any option, report it to Shawn Hargreaves
   (the author of Allegro).

If the errors you have are not one of the above, look at the sample program
to see what you are doing wrong.
If you cannot make it work whith it, you can contact me :


Contact Information :
-------------------
WWW     : http://www-inf.enst.fr/~vannier/

E-mail  : vannier@email.enst.fr

Address : Eric Vannier
          33, rue Barbes
          76100 Sotteville Les Rouen
          France
