[haiku-commits] haiku: hrev47744 - in src/add-ons/translators/jpeg2000/libjasper: . jasper

  • From: jerome.duval@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 26 Aug 2014 17:48:51 +0200 (CEST)

hrev47744 adds 1 changeset to branch 'master'
old head: e14f00e5e6c8d5eebc6100d82b3039a329dbd88b
new head: fdfe641dcafdc85fdd85e97a17e44bb439f1e675
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=fdfe641+%5Ee14f00e

----------------------------------------------------------------------------

fdfe641: JPEG2000Translator: use outsourced Jasper package
  
  * fixes for API changes with newer version of Jasper.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47744
Commit:      fdfe641dcafdc85fdd85e97a17e44bb439f1e675
URL:         http://cgit.haiku-os.org/haiku/commit/?id=fdfe641
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Tue Aug 26 15:47:25 2014 UTC

----------------------------------------------------------------------------

76 files changed, 55 insertions(+), 32022 deletions(-)
Jamfile                                          |    4 +-
.../translators/jpeg2000/JPEG2000Translator.cpp  |   88 +-
.../translators/jpeg2000/JPEG2000Translator.h    |    5 +-
src/add-ons/translators/jpeg2000/Jamfile         |   53 +-
.../translators/jpeg2000/libjasper/LICENSE       |  104 -
.../translators/jpeg2000/libjasper/README        |   23 -
.../translators/jpeg2000/libjasper/jas_debug.c   |  186 --
.../translators/jpeg2000/libjasper/jas_getopt.c  |  217 --
.../translators/jpeg2000/libjasper/jas_image.c   |  966 -------
.../translators/jpeg2000/libjasper/jas_init.c    |  199 --
.../translators/jpeg2000/libjasper/jas_malloc.c  |  167 --
.../translators/jpeg2000/libjasper/jas_seq.c     |  475 ----
.../translators/jpeg2000/libjasper/jas_stream.c  | 1174 --------
.../translators/jpeg2000/libjasper/jas_string.c  |  145 -
.../translators/jpeg2000/libjasper/jas_tvp.c     |  286 --
.../translators/jpeg2000/libjasper/jas_version.c |  116 -
.../translators/jpeg2000/libjasper/jasper.h      |  137 -
.../jpeg2000/libjasper/jasper/jas_debug.h        |  161 --
.../jpeg2000/libjasper/jasper/jas_fix.h          |  406 ---
.../jpeg2000/libjasper/jasper/jas_getopt.h       |  178 --
.../jpeg2000/libjasper/jasper/jas_image.h        |  588 ----
.../jpeg2000/libjasper/jasper/jas_init.h         |  128 -
.../jpeg2000/libjasper/jasper/jas_malloc.h       |  171 --
.../jpeg2000/libjasper/jasper/jas_math.h         |  164 --
.../jpeg2000/libjasper/jasper/jas_seq.h          |  344 ---
.../jpeg2000/libjasper/jasper/jas_stream.h       |  498 ----
.../jpeg2000/libjasper/jasper/jas_string.h       |  143 -
.../jpeg2000/libjasper/jasper/jas_tvp.h          |  198 --
.../jpeg2000/libjasper/jasper/jas_types.h        |  304 --
.../jpeg2000/libjasper/jasper/jas_version.h      |  167 --
.../translators/jpeg2000/libjasper/jp2_cod.c     |  932 ------
.../translators/jpeg2000/libjasper/jp2_cod.h     |  345 ---
.../translators/jpeg2000/libjasper/jp2_dec.c     |  650 -----
.../translators/jpeg2000/libjasper/jp2_dec.h     |  134 -
.../translators/jpeg2000/libjasper/jp2_enc.c     |  415 ---
.../translators/jpeg2000/libjasper/jpc_bs.c      |  484 ----
.../translators/jpeg2000/libjasper/jpc_bs.h      |  280 --
.../translators/jpeg2000/libjasper/jpc_cod.h     |  127 -
.../translators/jpeg2000/libjasper/jpc_cs.c      | 1614 -----------
.../translators/jpeg2000/libjasper/jpc_cs.h      |  812 ------
.../translators/jpeg2000/libjasper/jpc_dec.c     | 2334 ---------------
.../translators/jpeg2000/libjasper/jpc_dec.h     |  745 -----
.../translators/jpeg2000/libjasper/jpc_enc.c     | 2666 ------------------
.../translators/jpeg2000/libjasper/jpc_enc.h     |  695 -----
.../translators/jpeg2000/libjasper/jpc_fix.h     |  193 --
.../translators/jpeg2000/libjasper/jpc_flt.h     |  129 -
.../translators/jpeg2000/libjasper/jpc_math.c    |  170 --
.../translators/jpeg2000/libjasper/jpc_math.h    |  150 -
.../translators/jpeg2000/libjasper/jpc_mct.c     |  337 ---
.../translators/jpeg2000/libjasper/jpc_mct.h     |  160 --
.../translators/jpeg2000/libjasper/jpc_mqcod.c   |  228 --
.../translators/jpeg2000/libjasper/jpc_mqcod.h   |  173 --
.../translators/jpeg2000/libjasper/jpc_mqdec.c   |  355 ---
.../translators/jpeg2000/libjasper/jpc_mqdec.h   |  320 ---
.../translators/jpeg2000/libjasper/jpc_mqenc.c   |  441 ---
.../translators/jpeg2000/libjasper/jpc_mqenc.h   |  285 --
.../translators/jpeg2000/libjasper/jpc_qmfb.c    | 1135 --------
.../translators/jpeg2000/libjasper/jpc_qmfb.h    |  235 --
.../translators/jpeg2000/libjasper/jpc_t1cod.c   |  543 ----
.../translators/jpeg2000/libjasper/jpc_t1cod.h   |  344 ---
.../translators/jpeg2000/libjasper/jpc_t1dec.c   |  954 -------
.../translators/jpeg2000/libjasper/jpc_t1dec.h   |  137 -
.../translators/jpeg2000/libjasper/jpc_t1enc.c   | 1008 -------
.../translators/jpeg2000/libjasper/jpc_t1enc.h   |  142 -
.../translators/jpeg2000/libjasper/jpc_t2cod.c   |  733 -----
.../translators/jpeg2000/libjasper/jpc_t2cod.h   |  348 ---
.../translators/jpeg2000/libjasper/jpc_t2dec.c   |  626 ----
.../translators/jpeg2000/libjasper/jpc_t2dec.h   |  144 -
.../translators/jpeg2000/libjasper/jpc_t2enc.c   |  704 -----
.../translators/jpeg2000/libjasper/jpc_t2enc.h   |  155 -
.../translators/jpeg2000/libjasper/jpc_tagtree.c |  432 ---
.../translators/jpeg2000/libjasper/jpc_tagtree.h |  216 --
.../translators/jpeg2000/libjasper/jpc_tsfb.c    |  662 -----
.../translators/jpeg2000/libjasper/jpc_tsfb.h    |  222 --
.../translators/jpeg2000/libjasper/jpc_util.c    |  242 --
.../translators/jpeg2000/libjasper/jpc_util.h    |  126 -

----------------------------------------------------------------------------

diff --git a/Jamfile b/Jamfile
index 1686cef..0c03896 100644
--- a/Jamfile
+++ b/Jamfile
@@ -26,7 +26,7 @@ AddHaikuImagePackages [ FFilterByBuildFeatures
        curl freetype icu libsolv zlib
 
        regular_image @{
-               bzip2 ctags ffmpeg findutils gawk glu grep gutenprint jpeg less
+               bzip2 ctags ffmpeg findutils gawk glu grep gutenprint jasper 
jpeg less
                libpng libwebp mesa mesa_devel mesa_swrast sed sharutils tar 
tiff wget
                which
        }@
@@ -45,7 +45,7 @@ if $(HAIKU_PACKAGING_ARCHS[2]) {
                                curl freetype icu libsolv zlib
 
                                regular_image @{
-                                       ffmpeg glu jpeg libpng libwebp mesa
+                                       ffmpeg glu jasper jpeg libpng libwebp 
mesa
                                }@
                        ] ;
                        if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
diff --git a/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp 
b/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp
index bb2f3ac..f2f27b0 100644
--- a/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp
+++ b/src/add-ons/translators/jpeg2000/JPEG2000Translator.cpp
@@ -31,8 +31,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 #include "JPEG2000Translator.h"
-#include "jp2_cod.h"
-#include "jpc_cs.h"
 #include "TranslatorWindow.h"
 
 #include <syslog.h>
@@ -97,17 +95,21 @@ const uint32 kNumOutputFormats = sizeof(sOutputFormats) / 
sizeof(translation_for
 const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / 
sizeof(TranSetting);
 
 
+#define        JP2_BOX_JP              0x6a502020
+#define        JPC_MS_SOC              0xff4f
+
+
 namespace conversion{
 //!    Make RGB32 scanline from *pixels[3]
 inline void
-read_rgb24_to_rgb32(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+read_rgb24_to_rgb32(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
        while (x < width) {
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[2], x);
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[1], x);
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[0], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[2], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[1], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[0], x);
                scanline[index++] = 255;
                x++;
        }
@@ -116,13 +118,13 @@ read_rgb24_to_rgb32(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
 
 //!    Make gray scanline from *pixels[1]
 inline void
-read_gray_to_rgb32(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+read_gray_to_rgb32(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
-       jpr_uchar_t color = 0;
+       uchar color = 0;
        while (x < width) {
-               color = (jpr_uchar_t)jas_matrix_getv(pixels[0], x++);
+               color = (uchar)jas_matrix_getv(pixels[0], x++);
                scanline[index++] = color;
                scanline[index++] = color;
                scanline[index++] = color;
@@ -136,15 +138,15 @@ read_gray_to_rgb32(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just read data to scanline)
 */
 inline void
-read_rgba32(jas_matrix_t** pixels, jpr_uchar_t *scanline, int width)
+read_rgba32(jas_matrix_t** pixels, uchar *scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
        while (x < width) {
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[2], x);
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[1], x);
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[0], x);
-               scanline[index++] = (jpr_uchar_t)jas_matrix_getv(pixels[3], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[2], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[1], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[0], x);
+               scanline[index++] = (uchar)jas_matrix_getv(pixels[3], x);
                x++;
        }
 }
@@ -155,11 +157,11 @@ read_rgba32(jas_matrix_t** pixels, jpr_uchar_t *scanline, 
int width)
        (just read data to scanline)
 */
 inline void
-read_gray(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+read_gray(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        while (x < width) {
-               scanline[x] = (jpr_uchar_t)jas_matrix_getv(pixels[0], x);
+               scanline[x] = (uchar)jas_matrix_getv(pixels[0], x);
                x++;
        }
 }
@@ -167,7 +169,7 @@ read_gray(jas_matrix_t** pixels, jpr_uchar_t* scanline, int 
width)
 
 //!    Make *pixels[1] from gray1 scanline
 inline void
-write_gray1_to_gray(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_gray1_to_gray(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        int32 index = 0;
@@ -185,7 +187,7 @@ write_gray1_to_gray(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
 
 //!    Make *pixels[3] from gray1 scanline
 inline void
-write_gray1_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_gray1_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        int32 index = 0;
@@ -209,7 +211,7 @@ write_gray1_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
 
 //!    Make *pixels[3] from cmap8 scanline
 inline void
-write_cmap8_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_cmap8_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        const color_map* map = system_colors();
        int32 x = 0;
@@ -229,7 +231,7 @@ write_cmap8_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just write data to pixels)
 */
 inline void
-write_gray(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_gray(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        while (x < width) {
@@ -244,7 +246,7 @@ write_gray(jas_matrix_t** pixels, jpr_uchar_t* scanline, 
int width)
        (just write data to pixels)
 */
 inline void
-write_rgb15_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb15_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        int32 index = 0;
@@ -269,7 +271,7 @@ write_rgb15_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just write data to pixels)
 */
 inline void
-write_rgb15b_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb15b_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        int32 index = 0;
@@ -294,7 +296,7 @@ write_rgb15b_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just write data to pixels)
 */
 inline void
-write_rgb16_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb16_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        int32 index = 0;
@@ -319,7 +321,7 @@ write_rgb16_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just write data to pixels)
 */
 inline void
-write_rgb16b_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb16b_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 x = 0;
        int32 index = 0;
@@ -344,7 +346,7 @@ write_rgb16b_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just write data to pixels)
 */
 inline void
-write_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
@@ -362,7 +364,7 @@ write_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, 
int width)
        (just write data to pixels)
 */
 inline void
-write_rgb24b(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb24b(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
@@ -380,7 +382,7 @@ write_rgb24b(jas_matrix_t** pixels, jpr_uchar_t* scanline, 
int width)
        (just write data to pixels)
 */
 inline void
-write_rgb32_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb32_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
@@ -399,7 +401,7 @@ write_rgb32_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        (just write data to pixels)
 */
 inline void
-write_rgb32b_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgb32b_to_rgb24(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
@@ -419,7 +421,7 @@ write_rgb32b_to_rgb24(jas_matrix_t** pixels, jpr_uchar_t* 
scanline, int width)
        !!! UNTESTED !!!
 */
 inline void
-write_rgba32(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgba32(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
@@ -439,7 +441,7 @@ write_rgba32(jas_matrix_t** pixels, jpr_uchar_t* scanline, 
int width)
        !!! UNTESTED !!!
 */
 inline void
-write_rgba32b(jas_matrix_t** pixels, jpr_uchar_t* scanline, int width)
+write_rgba32b(jas_matrix_t** pixels, uchar* scanline, int width)
 {
        int32 index = 0;
        int32 x = 0;
@@ -905,11 +907,11 @@ JP2Translator::Compress(BPositionIO* in, BPositionIO* out)
 
        // Function pointer to write function
        // It MUST point to proper function
-       void (*converter)(jas_matrix_t** pixels, jpr_uchar_t* inscanline,
+       void (*converter)(jas_matrix_t** pixels, uchar* inscanline,
                int width) = write_rgba32;
 
        // Default color info
-       int out_color_space = JAS_IMAGE_CS_RGB;
+       int out_color_space = JAS_CLRSPC_SRGB;
        int out_color_components = 3;
 
        switch ((color_space)B_BENDIAN_TO_HOST_INT32(header.colors)) {
@@ -918,7 +920,7 @@ JP2Translator::Compress(BPositionIO* in, BPositionIO* out)
                                converter = write_gray1_to_rgb24;
                        } else {
                                out_color_components = 1;
-                               out_color_space = JAS_IMAGE_CS_GRAY;
+                               out_color_space = JAS_CLRSPC_SGRAY;
                                converter = write_gray1_to_gray;
                        }
                        break;
@@ -929,7 +931,7 @@ JP2Translator::Compress(BPositionIO* in, BPositionIO* out)
 
                case B_GRAY8:
                        out_color_components = 1;
-                       out_color_space = JAS_IMAGE_CS_GRAY;
+                       out_color_space = JAS_CLRSPC_SGRAY;
                        converter = write_gray;
                        break;
 
@@ -1024,7 +1026,7 @@ JP2Translator::Compress(BPositionIO* in, BPositionIO* out)
        if (image == (jas_image_t *)NULL)
                return Error(outs, NULL, NULL, 0, NULL, B_ERROR);
 
-       jpr_uchar_t *in_scanline = (jpr_uchar_t*) malloc(in_row_bytes);
+       uchar *in_scanline = (uchar*) malloc(in_row_bytes);
        if (in_scanline == NULL)
                return Error(outs, image, NULL, 0, NULL, B_ERROR);
 
@@ -1102,11 +1104,11 @@ JP2Translator::Decompress(BPositionIO* in, BPositionIO* 
out)
 
        // Function pointer to read function
        // It MUST point to proper function
-       void (*converter)(jas_matrix_t** pixels, jpr_uchar_t* outscanline,
+       void (*converter)(jas_matrix_t** pixels, uchar* outscanline,
                int width) = NULL;
 
-       switch (jas_image_colorspace(image)) {
-               case JAS_IMAGE_CS_RGB:
+       switch (jas_clrspc_fam(jas_image_clrspc(image))) {
+               case JAS_CLRSPC_FAM_RGB:
                        out_color_components = 4;
                        if (in_color_components == 3) {
                                out_color_space = B_RGB32;
@@ -1120,7 +1122,7 @@ JP2Translator::Decompress(BPositionIO* in, BPositionIO* 
out)
                                return Error(ins, image, NULL, 0, NULL, 
B_ERROR);
                        }
                        break;
-               case JAS_IMAGE_CS_GRAY:
+               case JAS_CLRSPC_FAM_GRAY:
                        if (fSettings->SetGetBool(JP2_SET_GRAY8_AS_B_RGB32)) {
                                out_color_space = B_RGB32;
                                out_color_components = 4;
@@ -1131,11 +1133,11 @@ JP2Translator::Decompress(BPositionIO* in, BPositionIO* 
out)
                                converter = read_gray;
                        }
                        break;
-               case JAS_IMAGE_CS_YCBCR:
+               case JAS_CLRSPC_FAM_YCBCR:
                        syslog(LOG_ERR, "Color space YCBCR not implemented 
yet.\n");
                        return Error(ins, image, NULL, 0, NULL, B_ERROR);
                        break;
-               case JAS_IMAGE_CS_UNKNOWN:
+               case JAS_CLRSPC_UNKNOWN:
                default:
                        syslog(LOG_ERR, "Color space unknown. \n");
                        return Error(ins, image, NULL, 0, NULL, B_ERROR);
@@ -1171,7 +1173,7 @@ JP2Translator::Decompress(BPositionIO* in, BPositionIO* 
out)
        if (err < (int)sizeof(TranslatorBitmap))
                return Error(ins, image, NULL, 0, NULL, B_ERROR);
 
-       jpr_uchar_t *out_scanline = (jpr_uchar_t*) malloc(out_row_bytes);
+       uchar *out_scanline = (uchar*) malloc(out_row_bytes);
        if (out_scanline == NULL)
                return Error(ins, image, NULL, 0, NULL, B_ERROR);
 
@@ -1266,7 +1268,7 @@ JP2Translator::PopulateInfoFromFormat(translator_info* 
info,
 */
 status_t
 Error(jas_stream_t* stream, jas_image_t* image, jas_matrix_t** pixels,
-       int32 pixels_count, jpr_uchar_t* scanline, status_t error)
+       int32 pixels_count, uchar* scanline, status_t error)
 {
        if (pixels) {
                int32 i;
diff --git a/src/add-ons/translators/jpeg2000/JPEG2000Translator.h 
b/src/add-ons/translators/jpeg2000/JPEG2000Translator.h
index fc6be22..204d9eb 100644
--- a/src/add-ons/translators/jpeg2000/JPEG2000Translator.h
+++ b/src/add-ons/translators/jpeg2000/JPEG2000Translator.h
@@ -50,7 +50,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <string.h>
 
 #include "BaseTranslator.h"
-#include "libjasper/jasper.h"
+#include "jasper/jasper.h"
 
 
 #undef B_TRANSLATION_CONTEXT
@@ -155,7 +155,8 @@ private:
                int32 formatCount);
 };
 
+
 status_t Error(jas_stream_t* stream, jas_image_t* image, jas_matrix_t** pixels,
-       int32 pixels_count, jpr_uchar_t* scanline, status_t error = B_ERROR);
+       int32 pixels_count, uchar* scanline, status_t error = B_ERROR);
 
 #endif // _JP2TRANSLATOR_H_
diff --git a/src/add-ons/translators/jpeg2000/Jamfile 
b/src/add-ons/translators/jpeg2000/Jamfile
index 58d8f85..ab18737 100644
--- a/src/add-ons/translators/jpeg2000/Jamfile
+++ b/src/add-ons/translators/jpeg2000/Jamfile
@@ -2,8 +2,6 @@ SubDir HAIKU_TOP src add-ons translators jpeg2000 ;
 
 SetSubDirSupportedPlatformsBeOSCompatible ;
 
-SubDirSysHdrs [ FDirName $(SUBDIR) libjasper ] ;
-
 SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
        #for BaseTranslator.h and friends
        
@@ -17,68 +15,27 @@ CCFLAGS += -DEXCLUDE_MIF_SUPPORT
 
 SubDirC++Flags [ FDefines BEOS_R5_COMPATIBLE ] ;
 
-local jasper_files = 
-       # libjasper (Base)
-       jas_debug.c
-       jas_getopt.c
-       jas_image.c
-       jas_init.c
-       jas_malloc.c
-       jas_seq.c
-       jas_stream.c
-       jas_string.c
-       jas_tvp.c
-       jas_version.c
-
-       # libjasper (JP2)
-       jp2_cod.c
-       jp2_dec.c
-       jp2_enc.c
-
-       # libjasper (JPC)
-       jpc_bs.c
-       jpc_cs.c
-       jpc_dec.c
-       jpc_enc.c
-       jpc_math.c
-       jpc_mct.c
-       jpc_mqcod.c
-       jpc_mqdec.c
-       jpc_mqenc.c
-       jpc_qmfb.c
-       jpc_t1cod.c
-       jpc_t1dec.c
-       jpc_t1enc.c
-       jpc_t2cod.c
-       jpc_t2dec.c
-       jpc_t2enc.c
-       jpc_tagtree.c
-       jpc_tsfb.c
-       jpc_util.c
-       ;
-
 AddResources JPEG2000Translator : JPEG2000Translator.rdef ;
 
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
-               # Let Jam know where to find some of our source files
-               SEARCH_SOURCE += [ FDirName $(SUBDIR) libjasper ] ;
-
-               ObjectCcFlags [ FGristFiles $(jasper_files:S=$(SUFOBJ)) ] : -w ;
+               UseBuildFeatureHeaders jasper ;
 
                Translator [ MultiArchDefaultGristFiles JPEG2000Translator ] :
 
                        # JPEG2000Translator
                        JPEG2000Translator.cpp
 
-                       $(jasper_files)
-
                        : be translation 
                        [ MultiArchDefaultGristFiles libtranslatorsutils.a ]
+                       [ BuildFeatureAttribute jasper : library ]
                        [ TargetLibsupc++ ] localestub
                        : true
                ;
+
+               Includes [ FGristFiles JPEG2000Translator.cpp ]
+                       : [ BuildFeatureAttribute jasper : headers ] ;
        }
 }
 
diff --git a/src/add-ons/translators/jpeg2000/libjasper/LICENSE 
b/src/add-ons/translators/jpeg2000/libjasper/LICENSE
deleted file mode 100644
index 5505add..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/LICENSE
+++ /dev/null
@@ -1,104 +0,0 @@
-JasPer Software License
-
-Copyright (c) 1999-2000, Image Power, Inc. and the University of British
-Columbia, Canada.
-Copyright (c) 2001-2002 Michael David Adams.
-All rights reserved.
-
-IMAGE POWER JPEG-2000 PUBLIC LICENSE
-************************************
-
-GRANT:
-
-Permission is hereby granted, free of charge, to any person (the "User")
-obtaining a copy of this software and associated documentation, to deal
-in the JasPer Software without restriction, including without limitation
-the right to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the JasPer Software (in source and binary forms),
-and to permit persons to whom the JasPer Software is furnished to do so,
-provided further that the License Conditions below are met.
-
-License Conditions
-******************
-
-A.  Redistributions of source code must retain the above copyright notice,
-and this list of conditions, and the following disclaimer.
-
-B.  Redistributions in binary form must reproduce the above copyright
-notice, and this list of conditions, and the following disclaimer in
-the documentation and/or other materials provided with the distribution.
-
-C.  Neither the name of Image Power, Inc. nor any other contributor
-(including, but not limited to, the University of British Columbia and
-Michael David Adams) may be used to endorse or promote products derived
-from this software without specific prior written permission.
-
-D.  User agrees that it shall not commence any action against Image Power,
-Inc., the University of British Columbia, Michael David Adams, or any
-other contributors (collectively "Licensors") for infringement of any
-intellectual property rights ("IPR") held by the User in respect of any
-technology that User owns or has a right to license or sublicense and
-which is an element required in order to claim compliance with ISO/IEC
-15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
-rights worldwide arising under statutory or common law, and whether
-or not perfected, including, without limitation, all (i) patents and
-patent applications owned or licensable by User; (ii) rights associated
-with works of authorship including copyrights, copyright applications,
-copyright registrations, mask work rights, mask work applications,
-mask work registrations; (iii) rights relating to the protection of
-trade secrets and confidential information; (iv) any right analogous
-to those set forth in subsections (i), (ii), or (iii) and any other
-proprietary rights relating to intangible property (other than trademark,
-trade dress, or service mark rights); and (v) divisions, continuations,
-renewals, reissues and extensions of the foregoing (as and to the extent
-applicable) now existing, hereafter filed, issued or acquired.
-
-E.  If User commences an infringement action against any Licensor(s) then
-such Licensor(s) shall have the right to terminate User's license and
-all sublicenses that have been granted hereunder by User to other parties.
-
-F.  This software is for use only in hardware or software products that
-are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
-or right to this Software is granted for products that do not comply
-with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
-from the ISO.
-
-THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
-NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
-THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
-CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
-WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
-IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
-TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
-OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
-PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
-THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
-IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
-IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
-OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
-OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
-REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
-WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
-INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
-MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
-JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
-THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
-CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
-DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
-MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
-SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
-OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
-FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
-RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
-FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
-AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
-LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
-JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
-TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
-("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
-OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
-KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
-TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
-CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
-NOTICE SPECIFIED IN THIS SECTION.
diff --git a/src/add-ons/translators/jpeg2000/libjasper/README 
b/src/add-ons/translators/jpeg2000/libjasper/README
deleted file mode 100644
index 9872887..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/README
+++ /dev/null
@@ -1,23 +0,0 @@
-JasPer Readme
-*************
-
-This is the source code distribution for JasPer.  JasPer is a collection
-of software (i.e., a library and application programs) for the coding
-and manipulation of images.  This software can handle image data in a
-variety of formats.  One such format supported by JasPer is the JPEG-2000
-code stream format defined in ISO/IEC 15444-1:2000.
-
-The complete licensing terms for the JasPer software can be found in
-the file named "LICENSE" in the top level directory of this software
-distribution.  Any use of this software contrary to the terms of the
-license is strictly prohibited.  The changes made to the software
-since the last release are described in the file "NEWS".  Detailed
-documentation on the JasPer software can be found in the JasPer Software
-Reference Manual.  This manual is located in the "doc" directory, and
-includes useful information such as: 1) how to build, install, and use
-the software, 2) how to report bugs, and 3) where to find additional
-information about the software.
-
-Enjoy! :)
-
---The JasPer Contributors
diff --git a/src/add-ons/translators/jpeg2000/libjasper/jas_debug.c 
b/src/add-ons/translators/jpeg2000/libjasper/jas_debug.c
deleted file mode 100644
index 8b1c1c0..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/jas_debug.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved.
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer Software License
- * 
- * IMAGE POWER JPEG-2000 PUBLIC LICENSE
- * ************************************
- * 
- * GRANT:
- * 
- * Permission is hereby granted, free of charge, to any person (the "User")
- * obtaining a copy of this software and associated documentation, to deal
- * in the JasPer Software without restriction, including without limitation
- * the right to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the JasPer Software (in source and binary forms),
- * and to permit persons to whom the JasPer Software is furnished to do so,
- * provided further that the License Conditions below are met.
- * 
- * License Conditions
- * ******************
- * 
- * A.  Redistributions of source code must retain the above copyright notice,
- * and this list of conditions, and the following disclaimer.
- * 
- * B.  Redistributions in binary form must reproduce the above copyright
- * notice, and this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * 
- * C.  Neither the name of Image Power, Inc. nor any other contributor
- * (including, but not limited to, the University of British Columbia and
- * Michael David Adams) may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * 
- * D.  User agrees that it shall not commence any action against Image Power,
- * Inc., the University of British Columbia, Michael David Adams, or any
- * other contributors (collectively "Licensors") for infringement of any
- * intellectual property rights ("IPR") held by the User in respect of any
- * technology that User owns or has a right to license or sublicense and
- * which is an element required in order to claim compliance with ISO/IEC
- * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
- * rights worldwide arising under statutory or common law, and whether
- * or not perfected, including, without limitation, all (i) patents and
- * patent applications owned or licensable by User; (ii) rights associated
- * with works of authorship including copyrights, copyright applications,
- * copyright registrations, mask work rights, mask work applications,
- * mask work registrations; (iii) rights relating to the protection of
- * trade secrets and confidential information; (iv) any right analogous
- * to those set forth in subsections (i), (ii), or (iii) and any other
- * proprietary rights relating to intangible property (other than trademark,
- * trade dress, or service mark rights); and (v) divisions, continuations,
- * renewals, reissues and extensions of the foregoing (as and to the extent
- * applicable) now existing, hereafter filed, issued or acquired.
- * 
- * E.  If User commences an infringement action against any Licensor(s) then
- * such Licensor(s) shall have the right to terminate User's license and
- * all sublicenses that have been granted hereunder by User to other parties.
- * 
- * F.  This software is for use only in hardware or software products that
- * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
- * or right to this Software is granted for products that do not comply
- * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
- * from the ISO.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
- * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
- * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
- * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
- * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
- * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
- * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
- * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
- * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
- * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
- * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
- * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
- * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
- * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
- * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
- * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
- * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
- * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
- * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
- * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
- * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
- * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
- * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
- * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
- * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
- * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
- * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
- * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
- * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
- * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
- * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
- * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
- * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
- * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
- * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
- * NOTICE SPECIFIED IN THIS SECTION.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-/******************************************************************************\
-* Includes.
-\******************************************************************************/
-
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "jasper/jas_debug.h"
-#include "jasper/jas_types.h"
-
-/******************************************************************************\
-* Local data.
-\******************************************************************************/
-
-static int jas_dbglevel = 0;
-/* The debug level. */
-
-/******************************************************************************\
-* Code for getting/setting the debug level.
-\******************************************************************************/
-
-/* Set the library debug level. */
-int jas_setdbglevel(int dbglevel)
-{
-       int olddbglevel;
-
-       /* Save the old debug level. */
-       olddbglevel = jas_dbglevel;
-
-       /* Change the debug level. */
-       jas_dbglevel = dbglevel;
-
-       /* Return the old debug level. */
-       return olddbglevel;
-}
-
-/* Get the library debug level. */
-int jas_getdbglevel(void)
-{
-       return jas_dbglevel;
-}
-
-/******************************************************************************\
-* Code.
-\******************************************************************************/
-
-/* Perform formatted output to standard error. */
-int jas_eprintf(const char *fmt, ...)
-{
-       int ret;
-       va_list ap;
-
-       va_start(ap, fmt);
-       ret = vfprintf(stderr, fmt, ap);
-       va_end(ap);
-       return ret;
-}
-
-/* Dump memory to a stream. */
-int jas_memdump(FILE *out, void *data, size_t len)
-{
-       unsigned int i;
-       unsigned int j;
-       jpr_uchar_t *dp;
-       dp = data;
-       for (i = 0; i < len; i += 16) {
-               fprintf(out, "%04x:", i);
-               for (j = 0; j < 16; ++j) {
-                       if (i + j < len) {
-                               fprintf(out, " %02x", dp[i + j]);
-                       }
-               }
-               fprintf(out, "\n");
-       }
-       return 0;
-}
diff --git a/src/add-ons/translators/jpeg2000/libjasper/jas_getopt.c 
b/src/add-ons/translators/jpeg2000/libjasper/jas_getopt.c
deleted file mode 100644
index 139efad..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/jas_getopt.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 1999-2000, Image Power, Inc. and the University of
- *   British Columbia.
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved. 
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer Software License
- * 
- * IMAGE POWER JPEG-2000 PUBLIC LICENSE
- * ************************************
- * 
- * GRANT:
- * 
- * Permission is hereby granted, free of charge, to any person (the "User")
- * obtaining a copy of this software and associated documentation, to deal
- * in the JasPer Software without restriction, including without limitation
- * the right to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the JasPer Software (in source and binary forms),
- * and to permit persons to whom the JasPer Software is furnished to do so,
- * provided further that the License Conditions below are met.
- * 
- * License Conditions
- * ******************
- * 
- * A.  Redistributions of source code must retain the above copyright notice,
- * and this list of conditions, and the following disclaimer.
- * 
- * B.  Redistributions in binary form must reproduce the above copyright
- * notice, and this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * 
- * C.  Neither the name of Image Power, Inc. nor any other contributor
- * (including, but not limited to, the University of British Columbia and
- * Michael David Adams) may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * 
- * D.  User agrees that it shall not commence any action against Image Power,
- * Inc., the University of British Columbia, Michael David Adams, or any
- * other contributors (collectively "Licensors") for infringement of any
- * intellectual property rights ("IPR") held by the User in respect of any
- * technology that User owns or has a right to license or sublicense and
- * which is an element required in order to claim compliance with ISO/IEC
- * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
- * rights worldwide arising under statutory or common law, and whether
- * or not perfected, including, without limitation, all (i) patents and
- * patent applications owned or licensable by User; (ii) rights associated
- * with works of authorship including copyrights, copyright applications,
- * copyright registrations, mask work rights, mask work applications,
- * mask work registrations; (iii) rights relating to the protection of
- * trade secrets and confidential information; (iv) any right analogous
- * to those set forth in subsections (i), (ii), or (iii) and any other
- * proprietary rights relating to intangible property (other than trademark,
- * trade dress, or service mark rights); and (v) divisions, continuations,
- * renewals, reissues and extensions of the foregoing (as and to the extent
- * applicable) now existing, hereafter filed, issued or acquired.
- * 
- * E.  If User commences an infringement action against any Licensor(s) then
- * such Licensor(s) shall have the right to terminate User's license and
- * all sublicenses that have been granted hereunder by User to other parties.
- * 
- * F.  This software is for use only in hardware or software products that
- * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
- * or right to this Software is granted for products that do not comply
- * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
- * from the ISO.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
- * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
- * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
- * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
- * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
- * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
- * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
- * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
- * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
- * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
- * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
- * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
- * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
- * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
- * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
- * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
- * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
- * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
- * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
- * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
- * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
- * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
- * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
- * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
- * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
- * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
- * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
- * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
- * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
- * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
- * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
- * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
- * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
- * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
- * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
- * NOTICE SPECIFIED IN THIS SECTION.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-/*
- * Command Line Option Parsing Library
- *
- * $Id: jas_getopt.c 14449 2005-10-20 12:15:56Z stippi $
- */
-
-/******************************************************************************\
-* Includes.
-\******************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-
-#include "jasper/jas_getopt.h"
-#include "jasper/jas_math.h"
-
-/******************************************************************************\
-* Global data.
-\******************************************************************************/
-
-int jas_optind = 0;
-int jas_opterr = 1;
-char *jas_optarg = 0;
-
-/******************************************************************************\
-* Code.
-\******************************************************************************/
-
-static jas_opt_t *jas_optlookup(jas_opt_t *opts, char *name)
-{
-       jas_opt_t *opt;
-
-       for (opt = opts; opt->id >= 0 && opt->name; ++opt) {
-               if (!strcmp(opt->name, name)) {
-                       return opt;
-               }
-       }
-       return 0;
-}
-
-int jas_getopt(int argc, char **argv, jas_opt_t *opts)
-{
-       char *cp;
-       int id;
-       int hasarg;
-       jas_opt_t *opt;
-       char *s;
-
-       if (!jas_optind) {
-               jas_optind = JAS_MIN(1, argc);
-       }
-       while (jas_optind < argc) {
-               s = cp = argv[jas_optind];
-               if (*cp == '-') {
-                       /* We are processing an option. */
-                       ++jas_optind;
-                       if (*++cp == '-') {
-                               /* We are processing a long option. */
-                               ++cp;
-                               if (*cp == '\0') {
-                                       /* This is the end of the options. */
-                                       return JAS_GETOPT_EOF;
-                               }
-                               if (!(opt = jas_optlookup(opts, cp))) {
-                                       if (jas_opterr) {
-                                               fprintf(stderr, "unknown long 
option %s\n", s);
-                                       }
-                                       return JAS_GETOPT_ERR;
-                               }
-                               hasarg = (opt->flags & JAS_OPT_HASARG) != 0;
-                               id = opt->id;
-                       } else {
-                               /* We are processing a short option. */
-                               if (strlen(cp) != 1 ||
-                                 !(opt = jas_optlookup(opts, cp))) {
-                                       if (jas_opterr) {
-                                               fprintf(stderr, "unknown short 
option %s\n", s);
-                                       }
-                                       return JAS_GETOPT_ERR;
-                               }
-                               hasarg = (opt->flags & JAS_OPT_HASARG) != 0;
-                               id = opt->id;
-                       }
-                       if (hasarg) {
-                               /* The option has an argument. */
-                               if (jas_optind >= argc) {
-                                       if (jas_opterr) {
-                                               fprintf(stderr, "missing 
argument for option %s\n", s);
-                                       }
-                                       return JAS_GETOPT_ERR;
-                               }
-                               jas_optarg = argv[jas_optind];
-                               ++jas_optind;
-                       } else {
-                               /* The option does not have an argument. */
-                               jas_optarg = 0;
-                       }
-                       return id;
-               } else {
-                       /* We are not processing an option. */
-                       return JAS_GETOPT_EOF;
-               }
-       }
-       return JAS_GETOPT_EOF;
-}
diff --git a/src/add-ons/translators/jpeg2000/libjasper/jas_image.c 
b/src/add-ons/translators/jpeg2000/libjasper/jas_image.c
deleted file mode 100644
index 54ce5dc..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/jas_image.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * Copyright (c) 1999-2000 Image Power, Inc. and the University of
- *   British Columbia.
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved.
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer Software License
- * 
- * IMAGE POWER JPEG-2000 PUBLIC LICENSE
- * ************************************
- * 
- * GRANT:
- * 
- * Permission is hereby granted, free of charge, to any person (the "User")
- * obtaining a copy of this software and associated documentation, to deal
- * in the JasPer Software without restriction, including without limitation
- * the right to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the JasPer Software (in source and binary forms),
- * and to permit persons to whom the JasPer Software is furnished to do so,
- * provided further that the License Conditions below are met.
- * 
- * License Conditions
- * ******************
- * 
- * A.  Redistributions of source code must retain the above copyright notice,
- * and this list of conditions, and the following disclaimer.
- * 
- * B.  Redistributions in binary form must reproduce the above copyright
- * notice, and this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * 
- * C.  Neither the name of Image Power, Inc. nor any other contributor
- * (including, but not limited to, the University of British Columbia and
- * Michael David Adams) may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * 
- * D.  User agrees that it shall not commence any action against Image Power,
- * Inc., the University of British Columbia, Michael David Adams, or any
- * other contributors (collectively "Licensors") for infringement of any
- * intellectual property rights ("IPR") held by the User in respect of any
- * technology that User owns or has a right to license or sublicense and
- * which is an element required in order to claim compliance with ISO/IEC
- * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
- * rights worldwide arising under statutory or common law, and whether
- * or not perfected, including, without limitation, all (i) patents and
- * patent applications owned or licensable by User; (ii) rights associated
- * with works of authorship including copyrights, copyright applications,
- * copyright registrations, mask work rights, mask work applications,
- * mask work registrations; (iii) rights relating to the protection of
- * trade secrets and confidential information; (iv) any right analogous
- * to those set forth in subsections (i), (ii), or (iii) and any other
- * proprietary rights relating to intangible property (other than trademark,
- * trade dress, or service mark rights); and (v) divisions, continuations,
- * renewals, reissues and extensions of the foregoing (as and to the extent
- * applicable) now existing, hereafter filed, issued or acquired.
- * 
- * E.  If User commences an infringement action against any Licensor(s) then
- * such Licensor(s) shall have the right to terminate User's license and
- * all sublicenses that have been granted hereunder by User to other parties.
- * 
- * F.  This software is for use only in hardware or software products that
- * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
- * or right to this Software is granted for products that do not comply
- * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
- * from the ISO.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
- * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
- * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
- * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
- * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
- * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
- * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
- * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
- * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
- * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
- * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
- * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
- * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
- * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
- * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
- * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
- * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
- * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
- * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
- * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
- * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
- * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
- * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
- * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
- * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
- * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
- * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
- * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
- * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
- * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
- * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
- * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
- * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
- * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
- * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
- * NOTICE SPECIFIED IN THIS SECTION.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-/*
- * Image Library
- *
- * $Id: jas_image.c 14449 2005-10-20 12:15:56Z stippi $
- */
-
-/******************************************************************************\
-* Includes.
-\******************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-#include "jasper/jas_math.h"
-#include "jasper/jas_image.h"
-#include "jasper/jas_malloc.h"
-#include "jasper/jas_string.h"
-
-/******************************************************************************\
-* Types.
-\******************************************************************************/
-
-/******************************************************************************\
-* Local prototypes.
-\******************************************************************************/
-
-static void jas_image_cmpt_destroy(jas_image_cmpt_t *cmpt);
-static jas_image_cmpt_t *jas_image_cmpt_create(uint_fast32_t tlx, 
uint_fast32_t tly,
-  uint_fast32_t hstep, uint_fast32_t vstep, uint_fast32_t width, uint_fast32_t
-  height, uint_fast16_t depth, JPR_BOOL sgnd, uint_fast32_t inmem);
-static void jas_image_setbbox(jas_image_t *image);
-static jas_image_cmpt_t *jas_image_cmpt_copy(jas_image_cmpt_t *cmpt);
-static jas_image_cmpt_t *jas_image_cmpt_create0();
-static int jas_image_growcmpts(jas_image_t *image, int maxcmpts);
-static uint_fast32_t inttobits(jas_seqent_t v, int prec, JPR_BOOL sgnd);
-static jas_seqent_t bitstoint(uint_fast32_t v, int prec, JPR_BOOL sgnd);
-
-/******************************************************************************\
-* Global data.
-\******************************************************************************/
-
-static int jas_image_numfmts = 0;
-static jas_image_fmtinfo_t jas_image_fmtinfos[JAS_IMAGE_MAXFMTS];
-
-/******************************************************************************\
-* Create and destroy operations.
-\******************************************************************************/
-
-jas_image_t *jas_image_create(uint_fast16_t numcmpts, jas_image_cmptparm_t 
*cmptparms,
-  int colorspace)
-{
-       jas_image_t *image;
-       uint_fast32_t rawsize;
-       uint_fast32_t inmem;
-       uint_fast16_t cmptno;
-       jas_image_cmptparm_t *cmptparm;
-
-       if (!(image = jas_image_create0())) {
-               return 0;
-       }
-
-       image->colorspace_ = colorspace;
-       image->maxcmpts_ = numcmpts;
-       image->inmem_ = JPR_TRUE;
-
-       /* Allocate memory for the per-component information. */
-       if (!(image->cmpts_ = jas_malloc(image->maxcmpts_ *
-         sizeof(jas_image_cmpt_t *)))) {
-               jas_image_destroy(image);
-               return 0;
-       }
-       /* Initialize in case of failure. */
-       for (cmptno = 0; cmptno < image->maxcmpts_; ++cmptno) {
-               image->cmpts_[cmptno] = 0;
-       }
-
-       /* Compute the approximate raw size of the image. */
-       rawsize = 0;
-       for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno,
-         ++cmptparm) {
-               rawsize += cmptparm->width * cmptparm->height *
-                 (cmptparm->prec + 7) / 8;
-       }
-       /* Decide whether to buffer the image data in memory, based on the
-         raw size of the image. */
-       inmem = (rawsize < JAS_IMAGE_INMEMTHRESH);
-
-       /* Create the individual image components. */
-       for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno,
-         ++cmptparm) {
-               if (!(image->cmpts_[cmptno] = 
jas_image_cmpt_create(cmptparm->tlx,
-                 cmptparm->tly, cmptparm->hstep, cmptparm->vstep,
-                 cmptparm->width, cmptparm->height, cmptparm->prec,
-                 cmptparm->sgnd, inmem))) {
-                       jas_image_destroy(image);
-                       return 0;
-               }
-               ++image->numcmpts_;
-       }
-
-       /* Determine the bounding box for all of the components on the
-         reference grid (i.e., the image area) */
-       jas_image_setbbox(image);
-
-       return image;
-}
-
-jas_image_t *jas_image_create0()
-{
-       jas_image_t *image;
-
-       if (!(image = jas_malloc(sizeof(jas_image_t)))) {
-               return 0;
-       }
-
-       image->tlx_ = 0;
-       image->tly_ = 0;
-       image->brx_ = 0;
-       image->bry_ = 0;
-       image->colorspace_ = JAS_IMAGE_CS_UNKNOWN;
-       image->numcmpts_ = 0;
-       image->maxcmpts_ = 0;
-       image->cmpts_ = 0;
-       image->inmem_ = JPR_TRUE;
-       image->iccp_ = 0;
-       image->iccplen_ = 0;
-
-       return image;
-}
-
-jas_image_t *jas_image_copy(jas_image_t *image)
-{
-       jas_image_t *newimage;
-       int cmptno;
-
-       newimage = jas_image_create0();
-       if (jas_image_growcmpts(newimage, image->numcmpts_)) {
-               goto error;
-       }
-       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
-               if (!(newimage->cmpts_[cmptno] = 
jas_image_cmpt_copy(image->cmpts_[cmptno]))) {
-                       goto error;
-               }
-               ++newimage->numcmpts_;
-       }
-
-       jas_image_setbbox(newimage);
-
-       return newimage;
-error:
-       if (newimage) {
-               jas_image_destroy(newimage);
-       }
-       return 0;
-}
-
-static jas_image_cmpt_t *jas_image_cmpt_create0()
-{
-       jas_image_cmpt_t *cmpt;
-       if (!(cmpt = jas_malloc(sizeof(jas_image_cmpt_t)))) {
-               return 0;
-       }
-       memset(cmpt, 0, sizeof(jas_image_cmpt_t));
-       cmpt->type_ = JAS_IMAGE_CT_UNKNOWN;
-       return cmpt;
-}
-
-static jas_image_cmpt_t *jas_image_cmpt_copy(jas_image_cmpt_t *cmpt)
-{
-       jas_image_cmpt_t *newcmpt;
-
-       if (!(newcmpt = jas_image_cmpt_create0())) {
-               return 0;
-       }
-       newcmpt->tlx_ = cmpt->tlx_;
-       newcmpt->tly_ = cmpt->tly_;
-       newcmpt->hstep_ = cmpt->hstep_;
-       newcmpt->vstep_ = cmpt->vstep_;
-       newcmpt->width_ = cmpt->width_;
-       newcmpt->height_ = cmpt->height_;
-       newcmpt->prec_ = cmpt->prec_;
-       newcmpt->sgnd_ = cmpt->sgnd_;
-       newcmpt->cps_ = cmpt->cps_;
-       newcmpt->type_ = cmpt->type_;
-       if (!(newcmpt->stream_ = jas_stream_memopen(0, 0))) {
-               return 0;
-       }
-       if (jas_stream_seek(cmpt->stream_, 0, SEEK_SET)) {
-               return 0;
-       }
-       if (jas_stream_copy(newcmpt->stream_, cmpt->stream_, -1)) {
-               return 0;
-       }
-       if (jas_stream_seek(newcmpt->stream_, 0, SEEK_SET)) {
-               return 0;
-       }
-       return newcmpt;
-}
-
-void jas_image_destroy(jas_image_t *image)
-{
-       int i;
-
-       if (image->cmpts_) {
-               for (i = 0; i < image->numcmpts_; ++i) {
-                       jas_image_cmpt_destroy(image->cmpts_[i]);
-                       image->cmpts_[i] = 0;
-               }
-               jas_free(image->cmpts_);
-       }
-       jas_free(image);
-}
-
-static jas_image_cmpt_t *jas_image_cmpt_create(uint_fast32_t tlx, 
uint_fast32_t tly,
-  uint_fast32_t hstep, uint_fast32_t vstep, uint_fast32_t width, uint_fast32_t
-  height, uint_fast16_t depth, JPR_BOOL sgnd, uint_fast32_t inmem)
-{
-       jas_image_cmpt_t *cmpt;
-       long size;
-
-       if (!(cmpt = jas_malloc(sizeof(jas_image_cmpt_t)))) {
-               return 0;
-       }
-
-       cmpt->tlx_ = tlx;
-       cmpt->tly_ = tly;
-       cmpt->hstep_ = hstep;
-       cmpt->vstep_ = vstep;
-       cmpt->width_ = width;
-       cmpt->height_ = height;
-       cmpt->prec_ = depth;
-       cmpt->sgnd_ = sgnd;
-       cmpt->stream_ = 0;
-       cmpt->cps_ = (depth + 7) / 8;
-
-       size = cmpt->width_ * cmpt->height_ * cmpt->cps_;
-       cmpt->stream_ = (inmem) ? jas_stream_memopen(0, size) : 
jas_stream_tmpfile();
-       if (!cmpt->stream_) {
-               jas_image_cmpt_destroy(cmpt);
-               return 0;
-       }
-
-       /* Zero the component data.  This isn't necessary, but it is
-       convenient for debugging purposes. */
-       if (jas_stream_seek(cmpt->stream_, size - 1, SEEK_SET) < 0 ||
-         jas_stream_putc(cmpt->stream_, 0) == EOF ||
-         jas_stream_seek(cmpt->stream_, 0, SEEK_SET) < 0) {
-               jas_image_cmpt_destroy(cmpt);
-               return 0;
-       }
-
-       return cmpt;
-}
-
-static void jas_image_cmpt_destroy(jas_image_cmpt_t *cmpt)
-{
-       if (cmpt->stream_) {
-               jas_stream_close(cmpt->stream_);
-       }
-       jas_free(cmpt);
-}
-
-/******************************************************************************\
-* Load and save operations.
-\******************************************************************************/
-
-jas_image_t *jas_image_decode(jas_stream_t *in, int fmt, char *optstr)
-{
-       jas_image_fmtinfo_t *fmtinfo;
-
-       /* If possible, try to determine the format of the input data. */
-       if (fmt < 0) {
-               if ((fmt = jas_image_getfmt(in)) < 0) {
-                       return 0;
-               }
-       }
-       if (!(fmtinfo = jas_image_lookupfmtbyid(fmt))) {
-               return 0;
-       }
-       return (fmtinfo->ops.decode) ? (*fmtinfo->ops.decode)(in, optstr) : 0;
-}
-
-int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt, char 
*optstr)
-{
-       jas_image_fmtinfo_t *fmtinfo;
-       if (!(fmtinfo = jas_image_lookupfmtbyid(fmt))) {
-               return -1;
-       }
-       return (fmtinfo->ops.encode) ? (*fmtinfo->ops.encode)(image, out,
-         optstr) : (-1);
-}
-
-/******************************************************************************\
-* Component read and write operations.
-\******************************************************************************/
-
-int jas_image_readcmpt(jas_image_t *image, uint_fast16_t cmptno, uint_fast32_t 
x, uint_fast32_t y, uint_fast32_t width,
-  uint_fast32_t height, jas_matrix_t *data)
-{
-       jas_image_cmpt_t *cmpt;
-       uint_fast32_t i;
-       uint_fast32_t j;
-       int k;
-       jas_seqent_t v;
-       int c;
-       jas_seqent_t *dr;
-       jas_seqent_t *d;
-       int drs;
-
-       if (cmptno < 0 || cmptno >= image->numcmpts_) {
-               return -1;
-       }
-
-       cmpt = image->cmpts_[cmptno];
-       if (x >= cmpt->width_ || y >= cmpt->height_ ||
-         x + width > cmpt->width_ ||
-         y + height > cmpt->height_) {
-               return -1;
-       }
-
-       if (jas_matrix_numrows(data) != height || jas_matrix_numcols(data) != 
width) {
-               if (jas_matrix_resize(data, height, width)) {
-                       return -1;
-               }
-       }
-
-       dr = jas_matrix_getref(data, 0, 0);
-       drs = jas_matrix_rowstep(data);
-       for (i = 0; i < height; ++i, dr += drs) {
-               d = dr;
-               if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * (y + i) + x)
-                 * cmpt->cps_, SEEK_SET) < 0) {
-                       return -1;
-               }
-               for (j = width; j > 0; --j, ++d) {
-                       v = 0;
-                       for (k = cmpt->cps_; k > 0; --k) {
-                               if ((c = jas_stream_getc(cmpt->stream_)) == 
EOF) {
-                                       return -1;
-                               }
-                               v = (v << 8) | (c & 0xff);
-                       }
-                       *d = bitstoint(v, cmpt->prec_, cmpt->sgnd_);
-               }
-       }
-
-       return 0;
-}
-
-#if 0
-int_fast64_t jas_image_readcmpt1(jas_image_t *image, uint_fast16_t cmptno,
-  uint_fast32_t x, uint_fast32_t y)
-{
-       jas_image_cmpt_t *cmpt;
-       int k;
-       int c;
-       int_fast64_t v;
-       cmpt = image->cmpts_[cmptno];
-       if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * y + x) * cmpt->cps_,
-         SEEK_SET) < 0) {
-               goto error;
-       }
-       v = 0;
-       for (k = cmpt->cps_; k > 0; --k) {
-               if ((c = jas_stream_getc(cmpt->stream_)) == EOF) {
-                       goto error;
-               }
-               v = (v << 8) | (c & 0xff);
-       }
-if (cmpt->sgnd_) {
-       abort();
-}
-
-       return v;
-
-error:
-       return 0;
-}
-#endif
-
-int jas_image_writecmpt(jas_image_t *image, uint_fast16_t cmptno, 
uint_fast32_t x, uint_fast32_t y, uint_fast32_t width,
-  uint_fast32_t height, jas_matrix_t *data)
-{
-       jas_image_cmpt_t *cmpt;
-       uint_fast32_t i;
-       uint_fast32_t j;
-       jas_seqent_t *d;
-       jas_seqent_t *dr;
-       int drs;
-       jas_seqent_t v;
-       int k;
-       int c;
-
-       if (cmptno < 0 || cmptno >= image->numcmpts_) {
-               return -1;
-       }
-
-       cmpt = image->cmpts_[cmptno];
-       if (x >= cmpt->width_ || y >= cmpt->height_ ||
-         x + width > cmpt->width_ ||
-         y + height > cmpt->height_) {
-               return -1;
-       }
-
-       if (jas_matrix_numrows(data) != height || jas_matrix_numcols(data) != 
width) {
-               return -1;
-       }
-
-       dr = jas_matrix_getref(data, 0, 0);
-       drs = jas_matrix_rowstep(data);
-       for (i = 0; i < height; ++i, dr += drs) {
-               d = dr;
-               if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * (y + i) + x)
-                 * cmpt->cps_, SEEK_SET) < 0) {
-                       return -1;
-               }
-               for (j = width; j > 0; --j, ++d) {
-                       v = inttobits(*d, cmpt->prec_, cmpt->sgnd_);
-                       for (k = cmpt->cps_; k > 0; --k) {
-                               c = (v >> (8 * (cmpt->cps_ - 1))) & 0xff;
-                               if (jas_stream_putc(cmpt->stream_,
-                                 (unsigned char) c) == EOF) {
-                                       return -1;
-                               }
-                               v <<= 8;
-                       }
-               }
-       }
-
-       return 0;
-}
-
-/******************************************************************************\
-* File format operations.
-\******************************************************************************/
-
-void jas_image_clearfmts()
-{
-       int i;
-       jas_image_fmtinfo_t *fmtinfo;
-       for (i = 0; i < jas_image_numfmts; ++i) {
-               fmtinfo = &jas_image_fmtinfos[i];
-               if (fmtinfo->name) {
-                       jas_free(fmtinfo->name);
-                       fmtinfo->name = 0;
-               }
-               if (fmtinfo->ext) {
-                       jas_free(fmtinfo->ext);
-                       fmtinfo->ext = 0;
-               }
-               if (fmtinfo->desc) {
-                       jas_free(fmtinfo->desc);
-                       fmtinfo->desc = 0;
-               }
-       }
-       jas_image_numfmts = 0;
-}
-
-int jas_image_addfmt(int id, char *name, char *ext, char *desc,
-  jas_image_fmtops_t *ops)
-{
-       jas_image_fmtinfo_t *fmtinfo;
-       assert(id >= 0 && name && ext && ops);
-       if (jas_image_numfmts >= JAS_IMAGE_MAXFMTS) {
-               return -1;
-       }
-       fmtinfo = &jas_image_fmtinfos[jas_image_numfmts];
-       fmtinfo->id = id;
-       if (!(fmtinfo->name = jas_strdup(name))) {
-               return -1;
-       }
-       if (!(fmtinfo->ext = jas_strdup(ext))) {
-               jas_free(fmtinfo->name);
-               return -1;
-       }
-       if (!(fmtinfo->desc = jas_strdup(desc))) {
-               jas_free(fmtinfo->name);
-               jas_free(fmtinfo->ext);
-               return -1;
-       }
-       fmtinfo->ops = *ops;
-       ++jas_image_numfmts;
-       return 0;
-}
-
-int jas_image_strtofmt(char *name)
-{
-       jas_image_fmtinfo_t *fmtinfo;
-       if (!(fmtinfo = jas_image_lookupfmtbyname(name))) {
-               return -1;
-       }
-       return fmtinfo->id;
-}
-
-char *jas_image_fmttostr(int fmt)
-{
-       jas_image_fmtinfo_t *fmtinfo;
-       if (!(fmtinfo = jas_image_lookupfmtbyid(fmt))) {
-               return 0;
-       }
-       return fmtinfo->name;
-}
-
-int jas_image_getfmt(jas_stream_t *in)
-{
-       jas_image_fmtinfo_t *fmtinfo;
-       int found;
-       int i;
-
-       /* Check for data in each of the supported formats. */
-       found = 0;
-       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i,
-         ++fmtinfo) {
-               if (fmtinfo->ops.validate) {
-                       /* Is the input data valid for this format? */
-                       if (!(*fmtinfo->ops.validate)(in)) {
-                               found = 1;
-                               break;
-                       }
-               }
-       }
-       return found ? fmtinfo->id : (-1);
-}
-
-int jas_image_fmtfromname(char *name)
-{
-       int i;
-       char *ext;
-       jas_image_fmtinfo_t *fmtinfo;
-       /* Get the file name extension. */
-       if (!(ext = strrchr(name, '.'))) {
-               return -1;
-       }
-       ++ext;
-       /* Try to find a format that uses this extension. */    
-       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i,
-         ++fmtinfo) {
-               /* Do we have a match? */
-               if (!strcmp(ext, fmtinfo->ext)) {
-                       return fmtinfo->id;
-               }
-       }
-       return -1;
-}
-
-/******************************************************************************\
-* Miscellaneous operations.
-\******************************************************************************/
-
-uint_fast32_t jas_image_rawsize(jas_image_t *image)
-{
-       uint_fast32_t rawsize;
-       uint_fast32_t cmptno;
-       jas_image_cmpt_t *cmpt;
-
-       rawsize = 0;
-       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
-               cmpt = image->cmpts_[cmptno];
-               rawsize += (cmpt->width_ * cmpt->height_ * cmpt->prec_ +
-                 7) / 8;
-       }
-       return rawsize;
-}
-
-void jas_image_delcmpt(jas_image_t *image, uint_fast16_t cmptno)
-{
-       if (cmptno >= image->numcmpts_) {
-               return;
-       }
-       jas_image_cmpt_destroy(image->cmpts_[cmptno]);
-       if (cmptno < image->numcmpts_) {
-               memmove(&image->cmpts_[cmptno], &image->cmpts_[cmptno + 1],
-                 (image->numcmpts_ - 1 - cmptno) * sizeof(jas_image_cmpt_t *));
-       }
-       --image->numcmpts_;
-
-       jas_image_setbbox(image);
-}
-
-int jas_image_addcmpt(jas_image_t *image, uint_fast16_t cmptno,
-  jas_image_cmptparm_t *cmptparm)
-{
-       jas_image_cmpt_t *newcmpt;
-       assert(cmptno >= 0 && cmptno <= image->numcmpts_);
-       if (image->numcmpts_ >= image->maxcmpts_) {
-               if (jas_image_growcmpts(image, image->maxcmpts_ + 128)) {
-                       return -1;
-               }
-       }
-       if (!(newcmpt = jas_image_cmpt_create(cmptparm->tlx,
-         cmptparm->tly, cmptparm->hstep, cmptparm->vstep,
-         cmptparm->width, cmptparm->height, cmptparm->prec,
-         cmptparm->sgnd, 1))) {
-               return -1;
-       }
-       if (cmptno < image->numcmpts_) {
-               memmove(&image->cmpts_[cmptno + 1], &image->cmpts_[cmptno],
-                 (image->numcmpts_ - cmptno) * sizeof(jas_image_cmpt_t *));
-       }
-       image->cmpts_[cmptno] = newcmpt;
-       ++image->numcmpts_;
-
-       jas_image_setbbox(image);
-
-       return 0;
-}
-
-jas_image_fmtinfo_t *jas_image_lookupfmtbyid(int id)
-{
-       int i;
-       jas_image_fmtinfo_t *fmtinfo;
-
-       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i, 
++fmtinfo) {
-               if (fmtinfo->id == id) {
-                       return fmtinfo;
-               }
-       }
-       return 0;
-}
-
-jas_image_fmtinfo_t *jas_image_lookupfmtbyname(const char *name)
-{
-       int i;
-       jas_image_fmtinfo_t *fmtinfo;
-
-       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i, 
++fmtinfo) {
-               if (!strcmp(fmtinfo->name, name)) {
-                       return fmtinfo;
-               }
-       }
-       return 0;
-}
-
-
-
-
-
-static uint_fast32_t inttobits(jas_seqent_t v, int prec, JPR_BOOL sgnd)
-{
-       uint_fast32_t ret;
-       ret = ((sgnd && v < 0) ? ((1 << prec) + v) : v) & JAS_ONES(prec);
-       return ret;
-}
-
-static jas_seqent_t bitstoint(uint_fast32_t v, int prec, JPR_BOOL sgnd)
-{
-       jas_seqent_t ret;
-       v &= JAS_ONES(prec);
-       ret = (sgnd && (v & (1 << (prec - 1)))) ? (v - (1 << prec)) : v;
-       return ret;
-}
-
-static void jas_image_setbbox(jas_image_t *image)
-{
-       jas_image_cmpt_t *cmpt;
-       int cmptno;
-       int_fast32_t x;
-       int_fast32_t y;
-
-       if (image->numcmpts_ > 0) {
-               /* Determine the bounding box for all of the components on the
-                 reference grid (i.e., the image area) */
-               cmpt = image->cmpts_[0];
-               image->tlx_ = cmpt->tlx_;
-               image->tly_ = cmpt->tly_;
-               image->brx_ = cmpt->tlx_ + cmpt->hstep_ * (cmpt->width_ - 1) + 
1;
-               image->bry_ = cmpt->tly_ + cmpt->vstep_ * (cmpt->height_ - 1) + 
1;
-               for (cmptno = 1; cmptno < image->numcmpts_; ++cmptno) {
-                       cmpt = image->cmpts_[cmptno];
-                       if (image->tlx_ > cmpt->tlx_) {
-                               image->tlx_ = cmpt->tlx_;
-                       }
-                       if (image->tly_ > cmpt->tly_) {
-                               image->tly_ = cmpt->tly_;
-                       }
-                       x = cmpt->tlx_ + cmpt->hstep_ * (cmpt->width_ - 1) + 1;
-                       if (image->brx_ < x) {
-                               image->brx_ = x;
-                       }
-                       y = cmpt->tly_ + cmpt->vstep_ * (cmpt->height_ - 1) + 1;
-                       if (image->bry_ < y) {
-                               image->bry_ = y;
-                       }
-               }
-       } else {
-               image->tlx_ = 0;
-               image->tly_ = 0;
-               image->brx_ = 0;
-               image->bry_ = 0;
-       }
-}
-
-static int jas_image_growcmpts(jas_image_t *image, int maxcmpts)
-{
-       jas_image_cmpt_t **newcmpts;
-       int cmptno;
-
-       newcmpts = (!image->cmpts_) ? jas_malloc(maxcmpts * 
sizeof(jas_image_cmpt_t *)) :
-         jas_realloc(image->cmpts_, maxcmpts * sizeof(jas_image_cmpt_t *));
-       if (!newcmpts) {
-               return -1;
-       }
-       image->cmpts_ = newcmpts;
-       image->maxcmpts_ = maxcmpts;
-       for (cmptno = image->numcmpts_; cmptno < image->maxcmpts_; ++cmptno) {
-               image->cmpts_[cmptno] = 0;
-       }
-       return 0;
-}
-
-int jas_image_copycmpt(jas_image_t *dstimage, int dstcmptno, jas_image_t 
*srcimage,
-  int srccmptno)
-{
-       jas_image_cmpt_t *newcmpt;
-       if (dstimage->numcmpts_ >= dstimage->maxcmpts_) {
-               if (jas_image_growcmpts(dstimage, dstimage->maxcmpts_ + 128)) {
-                       return -1;
-               }
-       }
-       if (!(newcmpt = jas_image_cmpt_copy(srcimage->cmpts_[srccmptno]))) {
-               return -1;
-       }
-       if (dstcmptno < dstimage->numcmpts_) {
-               memmove(&dstimage->cmpts_[dstcmptno + 1], 
&dstimage->cmpts_[dstcmptno],
-                 (dstimage->numcmpts_ - dstcmptno) * sizeof(jas_image_cmpt_t 
*));
-       }
-       dstimage->cmpts_[dstcmptno] = newcmpt;
-       ++dstimage->numcmpts_;
-
-       jas_image_setbbox(dstimage);
-       return 0;
-}
-
-void jas_image_dump(jas_image_t *image, FILE *out)
-{
-       int cmptno;
-       jas_seq2d_t *data;
-       jas_image_cmpt_t *cmpt;
-       if (!(data = jas_seq2d_create(0, 0, 1, 1))) {
-               abort();
-       }
-       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
-               cmpt = image->cmpts_[cmptno];
-               fprintf(out, "prec=%d sgnd=%d\n", cmpt->prec_, cmpt->sgnd_);
-               if (jas_image_readcmpt(image, cmptno, 0, 0, 1, 1, data)) {
-                       abort();
-               }
-               fprintf(out, "tlsample %ld\n", (long) jas_seq2d_get(data, 0, 
0));
-       }
-       jas_seq2d_destroy(data);
-}
-
-int jas_image_depalettize(jas_image_t *image, int cmptno, int numlutents,
-  int_fast32_t *lutents, int dtype, int newcmptno)
-{
-       jas_image_cmptparm_t cmptparms;
-       int_fast32_t v;
-       int i;
-       int j;
-       jas_image_cmpt_t *cmpt;
-
-       cmpt = image->cmpts_[cmptno];
-       cmptparms.tlx = cmpt->tlx_;
-       cmptparms.tly = cmpt->tly_;
-       cmptparms.hstep = cmpt->hstep_;
-       cmptparms.vstep = cmpt->vstep_;
-       cmptparms.width = cmpt->width_;
-       cmptparms.height = cmpt->height_;
-       cmptparms.prec = JAS_IMAGE_CDT_GETPREC(dtype);
-       cmptparms.sgnd = JAS_IMAGE_CDT_GETSGND(dtype);
-
-       if (jas_image_addcmpt(image, newcmptno, &cmptparms)) {
-               return -1;
-       }
-       if (newcmptno <= cmptno) {
-               ++cmptno;
-               cmpt = image->cmpts_[cmptno];
-       }
-
-       for (j = 0; j < cmpt->height_; ++j) {
-               for (i = 0; i < cmpt->width_; ++i) {
-                       v = jas_image_readcmptsample(image, cmptno, i, j);
-                       if (v < 0) {
-                               v = 0;
-                       } else if (v >= numlutents) {
-                               v = numlutents - 1;
-                       }
-                       jas_image_writecmptsample(image, newcmptno, i, j,
-                         lutents[v]);
-               }
-       }
-       return 0;
-}
-
-int jas_image_readcmptsample(jas_image_t *image, int cmptno, int x, int y)
-{
-       jas_image_cmpt_t *cmpt;
-       uint_fast32_t v;
-       int k;
-       int c;
-
-       cmpt = image->cmpts_[cmptno];
-
-       if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * y + x) * cmpt->cps_,
-         SEEK_SET) < 0) {
-               return -1;
-       }
-       v = 0;
-       for (k = cmpt->cps_; k > 0; --k) {
-               if ((c = jas_stream_getc(cmpt->stream_)) == EOF) {
-                       return -1;
-               }
-               v = (v << 8) | (c & 0xff);
-       }
-       return bitstoint(v, cmpt->prec_, cmpt->sgnd_);
-}
-
-void jas_image_writecmptsample(jas_image_t *image, int cmptno, int x, int y,
-  int_fast32_t v)
-{
-       jas_image_cmpt_t *cmpt;
-       uint_fast32_t t;
-       int k;
-       int c;
-
-       cmpt = image->cmpts_[cmptno];
-
-       if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * y + x) * cmpt->cps_,
-         SEEK_SET) < 0) {
-               return;
-       }
-       t = inttobits(v, cmpt->prec_, cmpt->sgnd_);
-       for (k = cmpt->cps_; k > 0; --k) {
-               c = (t >> (8 * (cmpt->cps_ - 1))) & 0xff;
-               if (jas_stream_putc(cmpt->stream_, (unsigned char) c) == EOF) {
-                       return;
-               }
-               t <<= 8;
-       }
-}
-
-int jas_image_getcmptbytype(jas_image_t *image, int ctype)
-{
-       int cmptno;
-
-       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
-               if (image->cmpts_[cmptno]->type_ == ctype) {
-                       return cmptno;
-               }
-       }
-}
diff --git a/src/add-ons/translators/jpeg2000/libjasper/jas_init.c 
b/src/add-ons/translators/jpeg2000/libjasper/jas_init.c
deleted file mode 100644
index 73141c6..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/jas_init.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved.
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer Software License
- * 
- * IMAGE POWER JPEG-2000 PUBLIC LICENSE
- * ************************************
- * 
- * GRANT:
- * 
- * Permission is hereby granted, free of charge, to any person (the "User")
- * obtaining a copy of this software and associated documentation, to deal
- * in the JasPer Software without restriction, including without limitation
- * the right to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the JasPer Software (in source and binary forms),
- * and to permit persons to whom the JasPer Software is furnished to do so,
- * provided further that the License Conditions below are met.
- * 
- * License Conditions
- * ******************
- * 
- * A.  Redistributions of source code must retain the above copyright notice,
- * and this list of conditions, and the following disclaimer.
- * 
- * B.  Redistributions in binary form must reproduce the above copyright
- * notice, and this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * 
- * C.  Neither the name of Image Power, Inc. nor any other contributor
- * (including, but not limited to, the University of British Columbia and
- * Michael David Adams) may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * 
- * D.  User agrees that it shall not commence any action against Image Power,
- * Inc., the University of British Columbia, Michael David Adams, or any
- * other contributors (collectively "Licensors") for infringement of any
- * intellectual property rights ("IPR") held by the User in respect of any
- * technology that User owns or has a right to license or sublicense and
- * which is an element required in order to claim compliance with ISO/IEC
- * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
- * rights worldwide arising under statutory or common law, and whether
- * or not perfected, including, without limitation, all (i) patents and
- * patent applications owned or licensable by User; (ii) rights associated
- * with works of authorship including copyrights, copyright applications,
- * copyright registrations, mask work rights, mask work applications,
- * mask work registrations; (iii) rights relating to the protection of
- * trade secrets and confidential information; (iv) any right analogous
- * to those set forth in subsections (i), (ii), or (iii) and any other
- * proprietary rights relating to intangible property (other than trademark,
- * trade dress, or service mark rights); and (v) divisions, continuations,
- * renewals, reissues and extensions of the foregoing (as and to the extent
- * applicable) now existing, hereafter filed, issued or acquired.
- * 
- * E.  If User commences an infringement action against any Licensor(s) then
- * such Licensor(s) shall have the right to terminate User's license and
- * all sublicenses that have been granted hereunder by User to other parties.
- * 
- * F.  This software is for use only in hardware or software products that
- * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
- * or right to this Software is granted for products that do not comply
- * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
- * from the ISO.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
- * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
- * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
- * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
- * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
- * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
- * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
- * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
- * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
- * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
- * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
- * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
- * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
- * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
- * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
- * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
- * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
- * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
- * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
- * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
- * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
- * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
- * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
- * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
- * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
- * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
- * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
- * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
- * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
- * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
- * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
- * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
- * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
- * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
- * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
- * NOTICE SPECIFIED IN THIS SECTION.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-/******************************************************************************\
-* Includes.
-\******************************************************************************/
-
-#include "jasper/jas_types.h"
-#include "jasper/jas_image.h"
-
-/******************************************************************************\
-* Code.
-\******************************************************************************/
-
-/* Initialize the image format table. */
-int jas_init()
-{
-       jas_image_fmtops_t fmtops;
-       int fmtid;
-
-       fmtid = 0;
-
-#if !defined(EXCLUDE_MIF_SUPPORT)
-       fmtops.decode = mif_decode;
-       fmtops.encode = mif_encode;
-       fmtops.validate = mif_validate;
-       jas_image_addfmt(fmtid, "mif", "mif", "My Image Format (MIF)", &fmtops);
-       ++fmtid;
-#endif
-
-#if !defined(EXCLUDE_PNM_SUPPORT)
-       fmtops.decode = pnm_decode;
-       fmtops.encode = pnm_encode;
-       fmtops.validate = pnm_validate;
-       jas_image_addfmt(fmtid, "pnm", "pnm", "Portable Graymap/Pixmap (PNM)",
-         &fmtops);
-       jas_image_addfmt(fmtid, "pnm", "pgm", "Portable Graymap/Pixmap (PNM)",
-         &fmtops);
-       jas_image_addfmt(fmtid, "pnm", "ppm", "Portable Graymap/Pixmap (PNM)",
-         &fmtops);
-       ++fmtid;
-#endif
-
-#if !defined(EXCLUDE_BMP_SUPPORT)
-       fmtops.decode = bmp_decode;
-       fmtops.encode = bmp_encode;
-       fmtops.validate = bmp_validate;
-       jas_image_addfmt(fmtid, "bmp", "bmp", "Microsoft Bitmap (BMP)", 
&fmtops);
-       ++fmtid;
-#endif
-
-#if !defined(EXCLUDE_RAS_SUPPORT)
-       fmtops.decode = ras_decode;
-       fmtops.encode = ras_encode;
-       fmtops.validate = ras_validate;
-       jas_image_addfmt(fmtid, "ras", "ras", "Sun Rasterfile (RAS)", &fmtops);
-       ++fmtid;
-#endif
-
-#if !defined(EXCLUDE_JP2_SUPPORT)
-       fmtops.decode = jp2_decode;
-       fmtops.encode = jp2_encode;
-       fmtops.validate = jp2_validate;
-       jas_image_addfmt(fmtid, "jp2", "jp2",
-         "JPEG-2000 JP2 File Format Syntax (ISO/IEC 15444-1)", &fmtops);
-       ++fmtid;
-       fmtops.decode = jpc_decode;
-       fmtops.encode = jpc_encode;
-       fmtops.validate = jpc_validate;
-       jas_image_addfmt(fmtid, "jpc", "jpc",
-         "JPEG-2000 Code Stream Syntax (ISO/IEC 15444-1)", &fmtops);
-       ++fmtid;
-#endif
-
-#if !defined(EXCLUDE_JPG_SUPPORT)
-       fmtops.decode = jpg_decode;
-       fmtops.encode = jpg_encode;
-       fmtops.validate = jpg_validate;
-       jas_image_addfmt(fmtid, "jpg", "jpg", "JPEG (ISO/IEC 10918-1)", 
&fmtops);
-       ++fmtid;
-#endif
-
-#if !defined(EXCLUDE_PGX_SUPPORT)
-       fmtops.decode = pgx_decode;
-       fmtops.encode = pgx_encode;
-       fmtops.validate = pgx_validate;
-       jas_image_addfmt(fmtid, "pgx", "pgx", "JPEG-2000 VM Format (PGX)", 
&fmtops);
-       ++fmtid;
-#endif
-
-       return 0;
-}
diff --git a/src/add-ons/translators/jpeg2000/libjasper/jas_malloc.c 
b/src/add-ons/translators/jpeg2000/libjasper/jas_malloc.c
deleted file mode 100644
index a84c3c9..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/jas_malloc.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1999-2000 Image Power, Inc. and the University of
- *   British Columbia.
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved.
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer Software License
- * 
- * IMAGE POWER JPEG-2000 PUBLIC LICENSE
- * ************************************
- * 
- * GRANT:
- * 
- * Permission is hereby granted, free of charge, to any person (the "User")
- * obtaining a copy of this software and associated documentation, to deal
- * in the JasPer Software without restriction, including without limitation
- * the right to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the JasPer Software (in source and binary forms),
- * and to permit persons to whom the JasPer Software is furnished to do so,
- * provided further that the License Conditions below are met.
- * 
- * License Conditions
- * ******************
- * 
- * A.  Redistributions of source code must retain the above copyright notice,
- * and this list of conditions, and the following disclaimer.
- * 
- * B.  Redistributions in binary form must reproduce the above copyright
- * notice, and this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * 
- * C.  Neither the name of Image Power, Inc. nor any other contributor
- * (including, but not limited to, the University of British Columbia and
- * Michael David Adams) may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * 
- * D.  User agrees that it shall not commence any action against Image Power,
- * Inc., the University of British Columbia, Michael David Adams, or any
- * other contributors (collectively "Licensors") for infringement of any
- * intellectual property rights ("IPR") held by the User in respect of any
- * technology that User owns or has a right to license or sublicense and
- * which is an element required in order to claim compliance with ISO/IEC
- * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
- * rights worldwide arising under statutory or common law, and whether
- * or not perfected, including, without limitation, all (i) patents and
- * patent applications owned or licensable by User; (ii) rights associated
- * with works of authorship including copyrights, copyright applications,
- * copyright registrations, mask work rights, mask work applications,
- * mask work registrations; (iii) rights relating to the protection of
- * trade secrets and confidential information; (iv) any right analogous
- * to those set forth in subsections (i), (ii), or (iii) and any other
- * proprietary rights relating to intangible property (other than trademark,
- * trade dress, or service mark rights); and (v) divisions, continuations,
- * renewals, reissues and extensions of the foregoing (as and to the extent
- * applicable) now existing, hereafter filed, issued or acquired.
- * 
- * E.  If User commences an infringement action against any Licensor(s) then
- * such Licensor(s) shall have the right to terminate User's license and
- * all sublicenses that have been granted hereunder by User to other parties.
- * 
- * F.  This software is for use only in hardware or software products that
- * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
- * or right to this Software is granted for products that do not comply
- * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
- * from the ISO.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
- * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
- * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
- * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
- * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
- * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
- * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
- * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
- * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
- * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
- * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
- * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
- * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
- * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
- * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
- * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
- * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
- * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
- * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
- * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
- * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
- * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
- * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
- * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
- * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
- * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
- * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
- * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
- * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
- * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
- * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
- * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
- * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
- * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
- * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
- * NOTICE SPECIFIED IN THIS SECTION.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-/*
- * Memory Allocator
- *
- * $Id: jas_malloc.c 14449 2005-10-20 12:15:56Z stippi $
- */
-
-/******************************************************************************\
-* Includes.
-\******************************************************************************/
-
-#include <stdio.h>
-
-/* We need the prototype for memset. */
-#include <string.h>
-
-#include "jasper/jas_malloc.h"
-
-/******************************************************************************\
-* Code.
-\******************************************************************************/
-
-#if defined(DEBUG_MEMALLOC)
-#include "../../../local/src/memalloc.c"
-#endif
-
-#if !defined(DEBUG_MEMALLOC)
-
-void *jas_malloc(size_t size)
-{
-       return malloc(size);
-}
-
-void jas_free(void *ptr)
-{
-       free(ptr);
-}
-
-void *jas_realloc(void *ptr, size_t size)
-{
-       return realloc(ptr, size);
-}
-
-void *jas_calloc(size_t nmemb, size_t size)
-{
-       void *ptr;
-       size_t n;
-       n = nmemb * size;
-       if (!(ptr = jas_malloc(n * sizeof(char)))) {
-               return 0;
-       }
-       memset(ptr, 0, n);
-       return ptr;
-}
-
-#endif
diff --git a/src/add-ons/translators/jpeg2000/libjasper/jas_seq.c 
b/src/add-ons/translators/jpeg2000/libjasper/jas_seq.c
deleted file mode 100644
index bdfe39c..0000000
--- a/src/add-ons/translators/jpeg2000/libjasper/jas_seq.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright (c) 1999-2000 Image Power, Inc. and the University of
- *   British Columbia.
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved.
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer Software License
- * 
- * IMAGE POWER JPEG-2000 PUBLIC LICENSE
- * ************************************
- * 
- * GRANT:
- * 
- * Permission is hereby granted, free of charge, to any person (the "User")
- * obtaining a copy of this software and associated documentation, to deal
- * in the JasPer Software without restriction, including without limitation
- * the right to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the JasPer Software (in source and binary forms),
- * and to permit persons to whom the JasPer Software is furnished to do so,
- * provided further that the License Conditions below are met.
- * 
- * License Conditions
- * ******************
- * 
- * A.  Redistributions of source code must retain the above copyright notice,
- * and this list of conditions, and the following disclaimer.
- * 
- * B.  Redistributions in binary form must reproduce the above copyright
- * notice, and this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * 
- * C.  Neither the name of Image Power, Inc. nor any other contributor
- * (including, but not limited to, the University of British Columbia and
- * Michael David Adams) may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * 
- * D.  User agrees that it shall not commence any action against Image Power,
- * Inc., the University of British Columbia, Michael David Adams, or any
- * other contributors (collectively "Licensors") for infringement of any
- * intellectual property rights ("IPR") held by the User in respect of any
- * technology that User owns or has a right to license or sublicense and
- * which is an element required in order to claim compliance with ISO/IEC
- * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
- * rights worldwide arising under statutory or common law, and whether
- * or not perfected, including, without limitation, all (i) patents and
- * patent applications owned or licensable by User; (ii) rights associated
- * with works of authorship including copyrights, copyright applications,
- * copyright registrations, mask work rights, mask work applications,
- * mask work registrations; (iii) rights relating to the protection of
- * trade secrets and confidential information; (iv) any right analogous
- * to those set forth in subsections (i), (ii), or (iii) and any other
- * proprietary rights relating to intangible property (other than trademark,
- * trade dress, or service mark rights); and (v) divisions, continuations,
- * renewals, reissues and extensions of the foregoing (as and to the extent
- * applicable) now existing, hereafter filed, issued or acquired.
- * 
- * E.  If User commences an infringement action against any Licensor(s) then
- * such Licensor(s) shall have the right to terminate User's license and
- * all sublicenses that have been granted hereunder by User to other parties.
- * 
- * F.  This software is for use only in hardware or software products that
- * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
- * or right to this Software is granted for products that do not comply
- * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
- * from the ISO.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
- * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
- * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
- * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
- * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
- * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
- * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
- * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
- * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
- * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
- * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
- * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
- * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
- * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
- * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
- * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
- * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
- * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
- * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
- * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
- * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
- * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
- * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
- * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
- * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
- * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
- * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
- * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
- * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
- * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
- * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
- * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
- * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
- * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
- * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
- * NOTICE SPECIFIED IN THIS SECTION.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-/*
- * Sequence/Matrix Library
- *
- * $Id: jas_seq.c 14449 2005-10-20 12:15:56Z stippi $
- */
-
-/******************************************************************************\
-* Includes.
-\******************************************************************************/
-
-#include <stdlib.h>
-#include <assert.h>
-#include <math.h>
-
-#include "jasper/jas_seq.h"
-#include "jasper/jas_malloc.h"
-#include "jasper/jas_math.h"
-
-/******************************************************************************\
-* Constructors and destructors.
-\******************************************************************************/
-
-jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend)
-{
-       jas_matrix_t *matrix;
-       assert(xstart <= xend && ystart <= yend);
-       if (!(matrix = jas_matrix_create(yend - ystart, xend - xstart))) {
-               return 0;
-       }
-       matrix->xstart_ = xstart;
-       matrix->ystart_ = ystart;
-       matrix->xend_ = xend;

[ *** diff truncated: 30305 lines dropped *** ]



Other related posts:

  • » [haiku-commits] haiku: hrev47744 - in src/add-ons/translators/jpeg2000/libjasper: . jasper - jerome . duval