darkma773r commented on pull request #116:
URL: https://github.com/apache/commons-imaging/pull/116#issuecomment-986136369


   @kinow, I have a couple of concerns about the API still. That being said, I 
don't want to single-handedly delay progress on the release, so please feel 
free to disagree with me. My main concerns are
   1. the ease of `ClassCastExceptions` being thrown on `Imaging` methods that 
accept `ImagingParameters` as arguments, and
   2. the way `JpegImagingParameters` extends`TiffImagingParameters`.
   
   We've discussed both of these before. For the first item, the simplest case 
is to just remove the methods that accept `ImagingParameters`. If we want to 
keep them, there might be promise in using the configurer callback approach, 
where the user passes a callback that accepts a parameters instance of the 
correct type (created by `ImageParser.getDefaultParameters()`) and configures 
it. Ex:
   ```java
   // ImagingParametersConfigurer.java
   @FunctionalInterface
   public ImagingParametersConfigurer {
       void configure(ImagingParameters p);
   }
   
   // Imaging.java
   public static ImageInfo getImageInfo(ByteSource bs, 
ImagingParametersConfigurer configurer) { ... }
   
   // user code
   ImageInfo info  = Imaging.getImageInfo(bs, p -> p.setStrict(true));
   ```
   
   Thanks for your tireless work on this!


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

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to