kinow 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_r348972234
 
 

 ##########
 File path: src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java
 ##########
 @@ -396,6 +363,7 @@ public void writeImage(final BufferedImage src, final 
OutputStream os, Map<Strin
         }
         params.remove(ImagingConstants.PARAM_KEY_PIXEL_DENSITY);
         params.remove(PngConstants.PARAM_KEY_PHYSICAL_SCALE);
+        params.remove(PngConstants.PARAM_KEY_PNG_DEFLATE_COMPRESSION_LEVEL);
 
 Review comment:
   The current API around those parameters is a bit strange. It requires you to 
remove them all, in order to validate you have valid parameters. It definitely 
needs changing, but for now we will have to stick with the current API.
   
   Looking at your change, you used `getOrDefault` instead of the suggested 
patch in that PR - which would work great. But you also had to call `.remove` 
here. So I think `compressionLevel` will be always-ever the default level?

----------------------------------------------------------------
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

Reply via email to