Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#4050 closed defect (fixed)

JP2KAK : offset in lossless unsigned int (16 bits)

Reported by: pinchonn Owned by: warmerdam
Priority: high Milestone: 1.11.0
Component: default Version: 1.9.0
Severity: blocker Keywords: kakadu lossless JP2KAK JPEG2000
Cc:

Description (last modified by pinchonn)

There is a problem with creating a lossless JPEG2000 image with JP2KAK (kakadu) from an unsigned int image : the output image has an +32768 offset. This offset seems to be constant.

The test image is an unsigned int TIFF image (see attachment).

I tried last GDAL versions : 1.8.1 and 1.9.0
Kakadu version is 6.4.1 (latest).
Platform is Linux Red Hat 5 64 bits.

To reproduce the bug :

gdal_translate -of JP2KAK -co QUALITY=100 input.tif out_gdal_translate.jp2

Using kakadu tools there is no problem :

kdu_compress -i input.tif -o out_kdu_compress.jp2 Creversible=yes Clayers=16

(Creversible is used instead of QUALITY=100)

Attachments (4)

input.zip (829.1 KB ) - added by pinchonn 13 years ago.
input image
out_gdal_translate.jp2 (850.6 KB ) - added by pinchonn 13 years ago.
ouput image created with gdal_translate
out_kdu_compress.jp2 (850.7 KB ) - added by pinchonn 13 years ago.
output image created with kdu_compress
jp2kakdataset.cpp (104.3 KB ) - added by GMaillet 12 years ago.
patched file to fix this problem

Change History (11)

by pinchonn, 13 years ago

Attachment: input.zip added

input image

by pinchonn, 13 years ago

Attachment: out_gdal_translate.jp2 added

ouput image created with gdal_translate

by pinchonn, 13 years ago

Attachment: out_kdu_compress.jp2 added

output image created with kdu_compress

comment:1 by pinchonn, 13 years ago

Severity: normalblocker
Version: unspecified1.8.0

comment:2 by pinchonn, 12 years ago

Resolution: fixed
Status: newclosed

comment:3 by pinchonn, 12 years ago

Description: modified (diff)
Keywords: JP2KAK JPEG2000 added
Resolution: fixed
Status: closedreopened
Version: 1.8.01.8.1

comment:4 by pinchonn, 12 years ago

Description: modified (diff)
Version: 1.8.11.9.0

comment:5 by GMaillet, 12 years ago

I had the same problem with 16-bit unsigned images. Pending an official correction I fix the problem by using 32 bit kdu_line_buf for reversible GDT_UInt16 images and substract the 32768 constant in the file frmts/jp2kak/jp2kakdataset.cpp.

by GMaillet, 12 years ago

Attachment: jp2kakdataset.cpp added

patched file to fix this problem

comment:6 by Even Rouault, 10 years ago

Milestone: 2.0
Resolution: fixed
Status: reopenedclosed

trunk r26626 "JP2KAK: fix creation of unsigned int16 with reversible compression (patch by GMaillet, #4050)"

comment:7 by Even Rouault, 10 years ago

Milestone: 2.01.11.0
Note: See TracTickets for help on using tickets.