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
commit 74fa0e65b91e6c0de70677f656e04a869b5ab35f Author: Gary Gregory <[email protected]> AuthorDate: Tue Jul 4 15:27:55 2023 -0400 No need to initialize to default value --- .../org/apache/commons/imaging/ColorTools.java | 2 +- .../java/org/apache/commons/imaging/Imaging.java | 26 +++++++++++----------- .../imaging/bytesource/ByteSourceImageTest.java | 4 ++-- .../commons/imaging/examples/SampleUsage.java | 4 ++-- .../commons/imaging/formats/jpeg/JpegReadTest.java | 2 +- .../commons/imaging/formats/png/PngReadTest.java | 2 +- .../commons/imaging/formats/psd/PsdReadTest.java | 2 +- .../commons/imaging/formats/tiff/TiffReadTest.java | 2 +- .../roundtrip/NullParametersRoundtripTest.java | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/org/apache/commons/imaging/ColorTools.java b/src/main/java/org/apache/commons/imaging/ColorTools.java index cfee38bc..a6a692af 100644 --- a/src/main/java/org/apache/commons/imaging/ColorTools.java +++ b/src/main/java/org/apache/commons/imaging/ColorTools.java @@ -133,7 +133,7 @@ public class ColorTools { public BufferedImage correctImage(final BufferedImage src, final File file) throws ImagingException, IOException { - final ICC_Profile icc = Imaging.getICCProfile(file); + final ICC_Profile icc = Imaging.getIccProfile(file); if (icc == null) { return src; } diff --git a/src/main/java/org/apache/commons/imaging/Imaging.java b/src/main/java/org/apache/commons/imaging/Imaging.java index 05e128a9..5f84002c 100644 --- a/src/main/java/org/apache/commons/imaging/Imaging.java +++ b/src/main/java/org/apache/commons/imaging/Imaging.java @@ -301,12 +301,12 @@ public final class Imaging { * @throws ImagingException if it fails to parse the image * @throws IOException if it fails to read the image data */ - public static ICC_Profile getICCProfile(final byte[] bytes) throws ImagingException, IOException { - return getICCProfile(ByteSource.array(bytes)); + public static ICC_Profile getIccProfile(final byte[] bytes) throws ImagingException, IOException { + return getIccProfile(ByteSource.array(bytes)); } - protected static ICC_Profile getICCProfile(final ByteSource byteSource) throws ImagingException, IOException { - final byte[] bytes = getICCProfileBytes(byteSource); + protected static ICC_Profile getIccProfile(final ByteSource byteSource) throws ImagingException, IOException { + final byte[] bytes = getIccProfileBytes(byteSource); if (bytes == null) { return null; } @@ -331,8 +331,8 @@ public final class Imaging { * @throws ImagingException if it fails to parse the image * @throws IOException if it fails to read the image data */ - public static ICC_Profile getICCProfile(final File file) throws ImagingException, IOException { - return getICCProfile(ByteSource.file(file)); + public static ICC_Profile getIccProfile(final File file) throws ImagingException, IOException { + return getIccProfile(ByteSource.file(file)); } /** @@ -344,8 +344,8 @@ public final class Imaging { * @throws ImagingException if it fails to parse the image * @throws IOException if it fails to read the image data */ - public static ICC_Profile getICCProfile(final InputStream is, final String fileName) throws ImagingException, IOException { - return getICCProfile(ByteSource.inputStream(is, fileName)); + public static ICC_Profile getIccProfile(final InputStream is, final String fileName) throws ImagingException, IOException { + return getIccProfile(ByteSource.inputStream(is, fileName)); } /** @@ -363,11 +363,11 @@ public final class Imaging { * @throws ImagingException if it fails to parse the image * @throws IOException if it fails to read the image data */ - public static byte[] getICCProfileBytes(final byte[] bytes) throws ImagingException, IOException { - return getICCProfileBytes(ByteSource.array(bytes)); + public static byte[] getIccProfileBytes(final byte[] bytes) throws ImagingException, IOException { + return getIccProfileBytes(ByteSource.array(bytes)); } - private static byte[] getICCProfileBytes(final ByteSource byteSource) throws ImagingException, IOException { + private static byte[] getIccProfileBytes(final ByteSource byteSource) throws ImagingException, IOException { final ImageParser<?> imageParser = ImageParserFactory.getImageParser(byteSource); return imageParser.getIccProfileBytes(byteSource, null); } @@ -387,8 +387,8 @@ public final class Imaging { * @throws ImagingException if it fails to parse the image * @throws IOException if it fails to read the image data */ - public static byte[] getICCProfileBytes(final File file) throws ImagingException, IOException { - return getICCProfileBytes(ByteSource.file(file)); + public static byte[] getIccProfileBytes(final File file) throws ImagingException, IOException { + return getIccProfileBytes(ByteSource.file(file)); } /** diff --git a/src/test/java/org/apache/commons/imaging/bytesource/ByteSourceImageTest.java b/src/test/java/org/apache/commons/imaging/bytesource/ByteSourceImageTest.java index efe3894b..0f6f5c13 100644 --- a/src/test/java/org/apache/commons/imaging/bytesource/ByteSourceImageTest.java +++ b/src/test/java/org/apache/commons/imaging/bytesource/ByteSourceImageTest.java @@ -71,9 +71,9 @@ public class ByteSourceImageTest extends ByteSourceTest { public void checkGetICCProfileBytes(final File imageFile, final byte[] imageFileBytes) throws Exception { // check guessFormat() - final byte[] iccBytesFile = Imaging.getICCProfileBytes(imageFile); + final byte[] iccBytesFile = Imaging.getIccProfileBytes(imageFile); - final byte[] iccBytesBytes = Imaging.getICCProfileBytes(imageFileBytes); + final byte[] iccBytesBytes = Imaging.getIccProfileBytes(imageFileBytes); assertEquals((iccBytesFile != null), (iccBytesBytes != null)); diff --git a/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java b/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java index ac72033f..70a2b33b 100644 --- a/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java +++ b/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java @@ -71,9 +71,9 @@ public class SampleUsage { Imaging.writeImage(image, os, format); // <b>get the image's embedded ICC Profile, if it has one. </b> - final byte[] iccProfileBytes = Imaging.getICCProfileBytes(imageBytes); + final byte[] iccProfileBytes = Imaging.getIccProfileBytes(imageBytes); - final ICC_Profile iccProfile = Imaging.getICCProfile(imageBytes); + final ICC_Profile iccProfile = Imaging.getIccProfile(imageBytes); // <b>get the image's width and height. </b> final Dimension d = Imaging.getImageSize(imageBytes); diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java index 290d3d7b..2b1e6717 100644 --- a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java +++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java @@ -51,7 +51,7 @@ public class JpegReadTest extends JpegBaseTest { //assertNotNull(metadata); Debug.debug("metadata", metadata); - Debug.debug("ICC profile", Imaging.getICCProfile(imageFile)); + Debug.debug("ICC profile", Imaging.getIccProfile(imageFile)); final ImageInfo imageInfo = Imaging.getImageInfo(imageFile); assertNotNull(imageInfo); diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java index f6d8f06a..e93b8bd8 100644 --- a/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java +++ b/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java @@ -71,7 +71,7 @@ public class PngReadTest extends PngBaseTest { final ImageInfo imageInfo = Imaging.getImageInfo(imageFile); assertNotNull(imageInfo); - Debug.debug("ICC profile", Imaging.getICCProfile(imageFile)); + Debug.debug("ICC profile", Imaging.getIccProfile(imageFile)); final BufferedImage image = Imaging.getBufferedImage(imageFile); assertNotNull(image); diff --git a/src/test/java/org/apache/commons/imaging/formats/psd/PsdReadTest.java b/src/test/java/org/apache/commons/imaging/formats/psd/PsdReadTest.java index 072dd4a5..b06edc19 100644 --- a/src/test/java/org/apache/commons/imaging/formats/psd/PsdReadTest.java +++ b/src/test/java/org/apache/commons/imaging/formats/psd/PsdReadTest.java @@ -46,7 +46,7 @@ public class PsdReadTest extends PsdBaseTest { final ImageInfo imageInfo = Imaging.getImageInfo(imageFile); assertNotNull(imageInfo); - Imaging.getICCProfile(imageFile); + Imaging.getIccProfile(imageFile); final BufferedImage image = Imaging.getBufferedImage(imageFile); assertNotNull(image); diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadTest.java index 25c1b02d..13723efe 100644 --- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadTest.java +++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadTest.java @@ -43,7 +43,7 @@ public class TiffReadTest extends TiffBaseTest { final ImageMetadata metadata = Imaging.getMetadata(imageFile); assertNotNull(metadata); - Debug.debug("ICC profile", Imaging.getICCProfile(imageFile)); + Debug.debug("ICC profile", Imaging.getIccProfile(imageFile)); final ImageInfo imageInfo = Imaging.getImageInfo(imageFile); assertNotNull(imageInfo); diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java b/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java index ee3d61e9..2d69e713 100644 --- a/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java +++ b/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java @@ -47,7 +47,7 @@ public class NullParametersRoundtripTest extends RoundtripBase { Imaging.getImageInfo(new ByteArrayInputStream(temp1), filename); Imaging.getImageSize(new ByteArrayInputStream(temp1), filename); Imaging.getMetadata(new ByteArrayInputStream(temp1), filename); - Imaging.getICCProfile(new ByteArrayInputStream(temp1), filename); + Imaging.getIccProfile(new ByteArrayInputStream(temp1), filename); final BufferedImage imageRead = Imaging.getBufferedImage(new ByteArrayInputStream(temp1), filename); assertNotNull(imageRead);
