kinow commented on a change in pull request #38: Cleaned up PNG component.
URL: https://github.com/apache/commons-imaging/pull/38#discussion_r284487696
 
 

 ##########
 File path: 
src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIhdr.java
 ##########
 @@ -16,43 +16,177 @@
  */
 package org.apache.commons.imaging.formats.png.chunks;
 
-import static org.apache.commons.imaging.common.BinaryFunctions.read4Bytes;
-import static org.apache.commons.imaging.common.BinaryFunctions.readByte;
-
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.nio.ByteBuffer;
 
 import org.apache.commons.imaging.ImageReadException;
+import org.apache.commons.imaging.formats.png.ChunkType;
 import org.apache.commons.imaging.formats.png.InterlaceMethod;
 import org.apache.commons.imaging.formats.png.PngColorType;
 
-public class PngChunkIhdr extends PngChunk {
-    public final int width;
-    public final int height;
-    public final int bitDepth;
-    public final PngColorType pngColorType;
-    public final int compressionMethod;
-    public final int filterMethod;
-    public final InterlaceMethod interlaceMethod;
+// BIG FAT NOTE: PngChunkIhdr has now become read-write (mutable) to
+// remove its duplicate PngWriter.ImageHeader.
 
-    public PngChunkIhdr(final int length, final int chunkType, final int crc, 
final byte[] bytes) throws ImageReadException, IOException {
+/**
+ * {@code PngChunkIhdr} are mutable PNG chunk objects that holds image
+ * header information.
+ * 
+ * Note that PngChunkIhdr was made mutable to allow PngWriter.ImageHeader
+ * to be removed. Other chunks are (supposed to be) immutable.
+ * 
+ * @author Shukant Pal
 
 Review comment:
   Author tags should be removed.

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