JDK-4829970 : Image I/O does not support PNG compression
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.imageio
  • Affected Version: 1.1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-03-10
  • Updated: 2016-09-20
  • Resolved: 2016-09-20
Related Reports
Duplicate :  
Duplicate :  
Description

Name: rmT116609			Date: 03/10/2003


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

FULL OS VERSION :
Windows 2000 ver 5.00.2195 Service Pack 2

A DESCRIPTION OF THE PROBLEM :
When obtaining a PNGImageWriteParam it does not support PNG compression or any of the extra options it should with the JAI Image I/O library.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Try the source listed below.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Should display "Can compress? true"
Should be able to set compression level etc.
Displays "Can compress? false"


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

import java.util.*;
import javax.imageio.*;

public class PNGTest {
	
    public static void main(String[] args) {
		
	ImageIO.scanForPlugins();
	
	Iterator writers = ImageIO.getImageWritersByFormatName("png");
	ImageWriter writer = (ImageWriter) writers.next();
	System.out.println(writer.getClass());
	ImageWriteParam param = writer.getDefaultWriteParam();
	System.out.println(param.getClass());
		
	System.out.println("Can compress? "+param.canWriteCompressed());
    }
}
---------- END SOURCE ----------
(Review ID: 182341) 
======================================================================

Comments
It looks to me as if this issue should be resolved as a duplicate of JDK-6488522. The test code prints class com.sun.imageio.plugins.png.PNGImageWriter class com.sun.imageio.plugins.png.PNGImageWriteParam Can compress? true and it is possible to set the compression quality.
29-08-2016

Please re-open if - if fix is in progress or on the plan to fix soon - if this is a P3 (file as P3, not P4)
18-03-2014