Opened 10 years ago

Closed 10 years ago

#3540 closed defect (fixed)

8 Bit JP2 image returns NBIT=1

Reported by: gaopeng Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.6.1
Severity: normal Keywords: jp2kak
Cc:

Description

Attached is an 8 bit JP2 image with values in 0-255 range. But the metadata item NBITS is set to 1.

Attachments (1)

customgraphic1.jp2 (434 bytes) - added by gaopeng 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by gaopeng

Attachment: customgraphic1.jp2 added

comment:1 Changed 10 years ago by warmerdam

Keywords: jp2kak added
Owner: changed from warmderdam to warmerdam

comment:2 Changed 10 years ago by warmerdam

Status: newassigned

I believe this is because one bit files are currently being automatically rescaled (poorly) to 8bit by the strip_decompressor. I'll dig a bit deeper.

Note, Gao has implemented a preliminary fix in 1.6-esri to drop the metadata (r19526).

comment:3 Changed 10 years ago by warmerdam

Gao,

I have modified the jp2kak driver in trunk to now actually fetch < 8bit images with their natural precision (r19533). Would you like me to backport this to the 1.6-esri tree?

comment:4 Changed 10 years ago by gaopeng

Frank,

Yes. Please.

comment:5 Changed 10 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

The changes have been backported into 1.6-esri (r19540) and r19526 has been backed out so NBITS shows up.

Note: See TracTickets for help on using tickets.