You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/21 19:57:43 UTC

[commons-imaging] branch master updated: Remove unused exception and simpler flow.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git


The following commit(s) were added to refs/heads/master by this push:
     new 6978d609 Remove unused exception and simpler flow.
6978d609 is described below

commit 6978d609ae3c2f74058f3049ff4354629c98063f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat May 21 15:57:39 2022 -0400

    Remove unused exception and simpler flow.
---
 src/main/java/org/apache/commons/imaging/formats/pcx/PcxWriter.java | 3 +--
 .../org/apache/commons/imaging/formats/tiff/TiffImageParser.java    | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/commons/imaging/formats/pcx/PcxWriter.java b/src/main/java/org/apache/commons/imaging/formats/pcx/PcxWriter.java
index 63b7fdce..6f2e4dcd 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pcx/PcxWriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pcx/PcxWriter.java
@@ -21,7 +21,6 @@ import java.io.OutputStream;
 import java.nio.ByteOrder;
 import java.util.Arrays;
 
-import org.apache.commons.imaging.ImageWriteException;
 import org.apache.commons.imaging.PixelDensity;
 import org.apache.commons.imaging.common.BinaryOutputStream;
 import org.apache.commons.imaging.palette.PaletteFactory;
@@ -34,7 +33,7 @@ class PcxWriter {
     private PixelDensity pixelDensity;
     private final RleWriter rleWriter;
 
-    PcxWriter(PcxImagingParameters params) throws ImageWriteException {
+    PcxWriter(PcxImagingParameters params) {
         // uncompressed PCX files are not even documented in ZSoft's spec,
         // let alone supported by most image viewers
         if (params == null) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
index e0d1d148..2e89afc6 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
@@ -502,8 +502,7 @@ public class TiffImageParser extends ImageParser<TiffImagingParameters> implemen
     }
 
     private Rectangle checkForSubImage(
-            final TiffImagingParameters params)
-            throws ImageReadException {
+            final TiffImagingParameters params) {
         // the params class enforces a correct specification for the
         // sub-image, but does not have knowledge of the actual
         // dimensions of the image that is being read.  This method
@@ -515,9 +514,8 @@ public class TiffImageParser extends ImageParser<TiffImagingParameters> implemen
             final int iwidth = params.getSubImageWidth();
             final int iheight = params.getSubImageHeight();
             return new Rectangle(ix0, iy0, iwidth, iheight);
-        } else {
-            return null;
         }
+        return null;
     }
 
     protected BufferedImage getBufferedImage(final TiffDirectory directory,