~ubuntu-branches/ubuntu/saucy/libjpeg-turbo/saucy-security

« back to all changes in this revision

Viewing changes to java/README

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2013-07-28 16:52:51 UTC
  • mfrom: (1.1.3) (9.1.1 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130728165251-7vg6wszhm941kdej
Tags: 1.3.0-0ubuntu1
* New upstream release.
  - drop debian/patches/branch-updates.diff
  - refresh tjunittest.patch (now renamed to install-tjunittest.patch)
* Update debian/control:
  - add myself to Uploaders.
* Update debian/copyright:
  - add RSA Data Security copyright (md5).
* Update debian/libturbojpeg.install:
  - install libturbojpeg.so.0* (needed by tjunittest and tjbench).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
TurboJPEG/OSS Java Wrapper
2
 
==========================
 
1
TurboJPEG Java Wrapper
 
2
======================
3
3
 
4
 
TurboJPEG/OSS can optionally be built with a Java Native Interface wrapper,
5
 
which allows the TurboJPEG/OSS dynamic library to be loaded and used directly
6
 
from Java applications.  The Java front end for this is defined in several
7
 
classes located under org/libjpegturbo/turbojpeg.  The source code for these
8
 
Java classes is licensed under a BSD-style license, so the files can be
9
 
incorporated directly into both open source and proprietary projects without
10
 
restriction.  A Java archive (JAR) file containing these classes is also
11
 
shipped with the "official" distribution packages of libjpeg-turbo.
 
4
The TurboJPEG shared library can optionally be built with a Java Native
 
5
Interface wrapper, which allows the library to be loaded and used directly from
 
6
Java applications.  The Java front end for this is defined in several classes
 
7
located under org/libjpegturbo/turbojpeg.  The source code for these Java
 
8
classes is licensed under a BSD-style license, so the files can be incorporated
 
9
directly into both open source and proprietary projects without restriction.  A
 
10
Java archive (JAR) file containing these classes is also shipped with the
 
11
"official" distribution packages of libjpeg-turbo.
12
12
 
13
13
TJExample.java, which should also be located in the same directory as this
14
 
README file, demonstrates how to use the TurboJPEG/OSS Java front end to
15
 
compress and decompress JPEG images in memory.
 
14
README file, demonstrates how to use the TurboJPEG Java API to compress and
 
15
decompress JPEG images in memory.
16
16
 
17
17
 
18
18
Performance Pitfalls
19
19
--------------------
20
20
 
21
 
The TurboJPEG Java front end defines several convenience methods that can
22
 
allocate image buffers or instantiate classes to hold the result of compress,
 
21
The TurboJPEG Java API defines several convenience methods that can allocate
 
22
image buffers or instantiate classes to hold the result of compress,
23
23
decompress, or transform operations.  However, if you use these methods, then
24
24
be mindful of the amount of new data you are creating on the heap.  It may be
25
25
necessary to manually invoke the garbage collector to prevent heap exhaustion
27
27
performance, particularly in a multi-threaded environment (Java pauses all
28
28
threads when the GC runs.)
29
29
 
30
 
The Java front end always gives you the option of pre-allocating your own
31
 
source and destination buffers, which allows you to re-use these buffers for
 
30
The TurboJPEG Java API always gives you the option of pre-allocating your own
 
31
source and destination buffers, which allows you to re-use those buffers for
32
32
compressing/decompressing multiple images.  If the image sequence you are
33
33
compressing or decompressing consists of images of the same size, then
34
34
pre-allocating the buffers is recommended.
35
35
 
36
36
 
37
 
Note for OS X users
38
 
-------------------
39
 
 
40
 
/usr/lib, the directory under which libturbojpeg.dylib is installed on Mac
41
 
systems, is not part of the normal Java library path.  Thus, when running a
42
 
Java application that uses TurboJPEG/OSS on Mac systems, you will need to pass
43
 
an argument of -Djava.library.path=/usr/lib to java.
44
 
 
45
 
 
46
 
Note for Solaris users
 
37
Installation Directory
47
38
----------------------
48
39
 
49
 
/opt/libjpeg-turbo/lib, the directory under which libturbojpeg.so is installed
50
 
on Solaris systems, is not part of the normal Java library path.  Thus, when
51
 
running a Java application that uses TurboJPEG/OSS on Solaris systems, you will
52
 
need to pass an argument of -Djava.library.path=/opt/libjpeg-turbo/lib to java.
53
 
If using a 64-bit data model, then instead pass an argument of
54
 
-Djava.library.path=/opt/libjpeg-turbo/lib/amd64 to use the 64-bit version of
55
 
libturbojpeg.so.
 
40
The TurboJPEG Java Wrapper will look for the TurboJPEG JNI library
 
41
(libturbojpeg.so, libturbojpeg.jnilib, or turbojpeg.dll) in the system library
 
42
paths or in any paths specified in LD_LIBRARY_PATH (Un*x), DYLD_LIBRARY_PATH
 
43
(Mac), or PATH (Windows.)  Failing this, on Un*x and Mac systems, the wrapper
 
44
will look for the JNI library under the library directory configured when
 
45
libjpeg-turbo was built.  If that library directory is
 
46
/opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and
 
47
vice versa.
 
48
 
 
49
If you installed the JNI library into another directory, then you will need
 
50
to pass an argument of -Djava.library.path={path_to_JNI_library} to java, or
 
51
manipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory
 
52
containing the JNI library.