blob: 87d3181b727c326fe3d771502a55d87e57434c4e [file] [log] [blame]
DRCf8e00552011-02-04 11:06:36 +00001TurboJPEG/OSS JNI Wrapper
2=========================
3
4TurboJPEG/OSS can optionally be built with a Java Native Interface wrapper,
5which allows the TurboJPEG/OSS dynamic library to be loaded and used directly
DRCc5a41992011-02-08 06:54:36 +00006from Java applications. The Java front end for this is defined in several
7classes located under org/libjpegturbo/turbojpeg. The source code for these
8Java classes is licensed under a BSD-style license, so the files can be
DRCf8e00552011-02-04 11:06:36 +00009incorporated directly into both open source and proprietary projects without
10restriction.
11
DRC2413cb82011-02-08 02:11:37 +000012TJExample.java, which should also be located in the same directory as this
DRCf8e00552011-02-04 11:06:36 +000013README file, demonstrates how to use the TurboJPEG/OSS Java front end to
14compress and decompress JPEG images in memory.
15
DRCc5a41992011-02-08 06:54:36 +000016 javac TJExample.java
DRCf8e00552011-02-04 11:06:36 +000017
18builds .class files for both the front end and example code.
19
20
21Note for OS X users
22-------------------
23
24/usr/lib, the directory under which libturbojpeg.dylib is installed on Mac
25systems, is not part of the normal Java library path. Thus, when running a
26Java application that uses TurboJPEG/OSS on Mac systems, you will need to pass
27an argument of -Djava.library.path=/usr/lib to java.
DRCed6526f2011-02-05 05:41:18 +000028
29
30Note for Solaris users
31----------------------
32
33/opt/libjpeg-turbo/lib, the directory under which libturbojpeg.so is installed
34on Solaris systems, is not part of the normal Java library path. Thus, when
35running a Java application that uses TurboJPEG/OSS on Solaris systems, you will
36need to pass an argument of -Djava.library.path=/opt/libjpeg-turbo/lib to java.
37If using a 64-bit data model, then instead pass an argument of
38-Djava.library.path=/opt/libjpeg-turbo/lib/amd64 to use the 64-bit version of
39libturbojpeg.so.
DRCf2214c22011-02-05 05:51:46 +000040
41
42Note for MinGW users
43--------------------
44
45When libjpeg-turbo is built with MinGW, the TurboJPEG/OSS dynamic library is
46named libturbojpeg.dll instead of turbojpeg.dll. This is in keeping with the
47convention of MinGW, and it also avoids a filename conflict when the GCC and
48Visual C++ versions of the libjpeg-turbo SDK are installed on the same system.
49However, the TurboJPEG/OSS JNI wrapper will not work on Windows unless the DLL
50is named turbojpeg.dll. You can work around this by renaming the DLL or by
DRC2413cb82011-02-08 02:11:37 +000051simply changing the LoadLibrary() calls in TurboJPEG.java so that they load
DRCf2214c22011-02-05 05:51:46 +000052"libturbojpeg" instead of "turbojpeg".