Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4972087
Votes 0
Synopsis Quality Desc and Quality Values arrays are of same length for JPG
Category java:imageio
Reported Against 1.4
Release Fixed mustang(b56)
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs
Submit Date 23-DEC-2003
Description
The API specification for getcompressionQualityDescriptions() claims that the array length of the compression quality values returned by the ImageWriteParam must always be one greater than the array length of quality descriptions returned by the same write param for any image format. This does not work for JPG. For JPG, both the arrays returned are of same length.

This is reproducible right from JDK1.4 on all the platforms.

I have attached a sample code. Execute the sample code and watch the console. If the array length of quality desc and quality values are same then the bug is reproduced.
  xxxxx@xxxxx   2003-12-23

Attached the testcase.

  xxxxx@xxxxx   2003-12-23
Work Around
N/A
Evaluation
The problem is that when the JPEGImageWriteParam code was written, it was
assumed that the compression quality values have a one-to-one mapping to
the compression quality descriptions.  But with a careful reading of the
ImageWriteParam spec, it is noticed that the descriptions should refer
to a range of values.  (So vals.length should be descs.length+1...)

Since the existing descriptions match specific values, we thought it would
be good to change the descriptions and values slightly to fit:
        "Low quality",       // 0.00 -> 0.30
        "Medium quality",    // 0.30 -> 0.75
        "Visually lossless"  // 0.75 -> 1.00
Posted Date : 2005-09-30 22:15:35.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang