gwlucastrig commented on pull request #108:
URL: https://github.com/apache/commons-imaging/pull/108#issuecomment-731867351


   A better name for the transcriber class would be a good idea...  in terms
   of the directories, I have no strong preference.  One thing to keep in mind
   is the a TIFF can be a bundle of multiple images and the directory (the
   IFD) is the main unit of organization.  But the nesting of classes in
   Commons Imaging is a bit awkward and could benefit from some TLC.
   
   On Sun, Nov 22, 2020, 5:20 PM Bruno P. Kinoshita <[email protected]>
   wrote:
   
   > *@kinow* commented on this pull request.
   >
   > Had a cursory look @gwlucastrig <https://github.com/gwlucastrig> , looks
   > good, and great improvement for Imaging! 👨‍🚀 ⭐
   >
   > Few comments, but will use the IDE to confirm what I have said 👍
   > ------------------------------
   >
   > In
   > src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java
   > <https://github.com/apache/commons-imaging/pull/108#discussion_r528412185>
   > :
   >
   > > +     *   params.put(TiffConstants.PARAM_KEY_SUBIMAGE_HEIGHT, height);
   >
   > +     *   ImageBuilder imageBuilder = directory.getImageBuilder(params);
   >
   > +     * </pre>
   >
   > +     *
   >
   > +     * @param params an optional parameter map instance
   >
   > +     * @return a valid instance
   >
   > +     * @throws ImageReadException in the event of incompatible or 
malformed data
   >
   > +     * @throws IOException in the event of an I/O error
   >
   > +     */
   >
   > +    public ImageBuilder getImageBuilder(
   >
   > +        final Map<String, Object> params)
   >
   > +        throws ImageReadException, IOException {
   >
   > +        TiffImageParser parser = new TiffImageParser();
   >
   > +        return parser.getImageBuilder(this, headerByteOrder, params);
   >
   > +    }
   >
   > +
   >
   >
   > @gwlucastrig <https://github.com/gwlucastrig> maybe we could rethink
   > this? It strikes me as strange/risky having the ImageBuilder and
   > TiffDirectory so tightly tied. I think the builder creates/uses
   > directories; and—if that relationship really exists—then it would be a
   > circular dependency by accessing the Builder from the Directory. Will take
   > a better look later with the IDE 👍
   > ------------------------------
   >
   > In
   > 
src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterTranscribeSample0.java
   > <https://github.com/apache/commons-imaging/pull/108#discussion_r528412591>
   > :
   >
   > > + * does not transform the content of a TIFF image to the RGB format
   >
   > + * but simply transcribes the first sample at each pixel location to an 
integer.
   >
   > + * <p>
   >
   > + * This class is meant to support applications that use TIFF files to 
store
   >
   > + * integer data rather than imagery. This approach is widely used in
   >
   > + * GeoTIFF image formats to store geophysical data.
   >
   > + * <p>
   >
   > + * Note that this implementation only processes the first sample for a 
pixel.
   >
   > + * Developers requiring access to additional samples may use this class as
   >
   > + * an example.  However, the ImageBuilder class currently has the 
limitation
   >
   > + * that it cannot store more than one 32 bit integer per pixel or
   >
   > + * raster cell.
   >
   > + * <p>
   >
   > + * The data stored by this class is treated as a signed integer value.
   >
   > + */
   >
   > +public class PhotometricInterpreterTranscribeSample0 extends 
PhotometricInterpreter {
   >
   >
   > Maybe we could have a different name? Instead of
   > PhotometricInterpreterTranscribeSample0, would it make sense to have
   > something like ...Basic, ...Default, etc? This way we avoid having future
   > classes with names that do not match the pattern ...0, ...1, etc.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/commons-imaging/pull/108#pullrequestreview-536120549>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AEWJDYPMSOUVNY2KPNBQF6TSRGFCTANCNFSM4T6N6XKA>
   > .
   >
   


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


Reply via email to