adorn commented on a change in pull request #58: [IMAGING-243] PNG Writer
Indexed Color with semi-transparent Pixels and Better Compression
URL: https://github.com/apache/commons-imaging/pull/58#discussion_r348460761
##########
File path: src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java
##########
@@ -596,8 +588,10 @@ public void writeImage(final BufferedImage src, final
OutputStream os, Map<Strin
// Debug.debug("uncompressed", uncompressed.length);
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final DeflaterOutputStream dos = new DeflaterOutputStream(baos);
final int chunkSize = 256 * 1024;
+ Deflater deflater = new Deflater(Deflater.BEST_COMPRESSION);
Review comment:
That's also OK. Should I add some PngConstants?
PARAM_KEY_PNG_DEFLATE_COMPRESSION_LEVEL ="PNG_DEFLATE_COMPRESSION_LEVEL";
public static final int PNG_DEFLATE_COMPRESSION_LEVEL_DEFAULT=
Deflater.DEFAULT_COMPRESSION;
public static final int PNG_DEFLATE_COMPRESSION_LEVEL_BEST_COMPRESSION=
Deflater.BEST_COMPRESSION;
public static final int PNG_DEFLATE_COMPRESSION_LEVEL_BEST_SPEED=
Deflater.BEST_SPEED;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services