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 7e803edd Fix formatting 7e803edd is described below commit 7e803edd5a4b34ff505198a11a04ffe8e1b51a88 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue Aug 22 10:58:46 2023 -0400 Fix formatting --- .../java/org/apache/commons/imaging/formats/png/PngWriter.java | 2 +- .../imaging/formats/png/scanlinefilters/ScanlineFilterSub.java | 2 +- .../imaging/formats/png/scanlinefilters/ScanlineFilterUp.java | 2 +- .../org/apache/commons/imaging/formats/pnm/PnmImageParser.java | 10 +++++----- .../apache/commons/imaging/formats/tiff/TiffRasterData.java | 2 +- .../imaging/formats/tiff/write/AbstractTiffImageWriter.java | 6 +++--- .../imaging/formats/tiff/write/TiffOutputDirectory.java | 2 +- .../commons/imaging/formats/tiff/write/TiffOutputField.java | 2 +- .../commons/imaging/examples/tiff/ReadTagsAndImages.java | 8 ++++---- .../formats/tiff/TiffFloatingPointMultivariableTest.java | 10 +++++----- .../org/apache/commons/imaging/formats/tiff/TiffReadTest.java | 2 +- .../apache/commons/imaging/formats/tiff/TiffSubImageTest.java | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java b/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java index f9c38002..b3aaefe1 100644 --- a/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java +++ b/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java @@ -477,7 +477,7 @@ public class PngWriter { !isGrayscale && palette==null; byte[] uncompressed; - if(!usePredictor) { + if (!usePredictor) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final boolean useAlpha = pngColorType == PngColorType.GREYSCALE_WITH_ALPHA diff --git a/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java b/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java index 9a91aed3..051d919d 100644 --- a/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java +++ b/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java @@ -39,7 +39,7 @@ public class ScanlineFilterSub implements ScanlineFilter { dst[i] = src[i]; } - // if(i<10) + // if (i<10) // System.out.println("\t" + i + ": " + dst[i] + " (" + src[i] + // ", " + prevIndex + ")"); diff --git a/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java b/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java index 1c14a387..0fe5a2c3 100644 --- a/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java +++ b/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java @@ -34,7 +34,7 @@ public class ScanlineFilterUp implements ScanlineFilter { dst[i] = src[i]; } - // if(i<10) + // if (i<10) // System.out.println("\t" + i + ": " + dst[i]); // dst[i] = b; // dst[i] = src[i]; diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java b/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java index aa28f8cd..2a060373 100644 --- a/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java +++ b/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java @@ -262,31 +262,31 @@ public class PnmImageParser extends AbstractImageParser<PnmImagingParameters> { final String type = tokenizer.nextToken(); if ("WIDTH".equals(type)) { seenWidth = true; - if(!tokenizer.hasMoreTokens()) { + if (!tokenizer.hasMoreTokens()) { throw new ImagingException("PAM header has no WIDTH value"); } width = Integer.parseInt(tokenizer.nextToken()); } else if ("HEIGHT".equals(type)) { seenHeight = true; - if(!tokenizer.hasMoreTokens()) { + if (!tokenizer.hasMoreTokens()) { throw new ImagingException("PAM header has no HEIGHT value"); } height = Integer.parseInt(tokenizer.nextToken()); } else if ("DEPTH".equals(type)) { seenDepth = true; - if(!tokenizer.hasMoreTokens()) { + if (!tokenizer.hasMoreTokens()) { throw new ImagingException("PAM header has no DEPTH value"); } depth = Integer.parseInt(tokenizer.nextToken()); } else if ("MAXVAL".equals(type)) { seenMaxVal = true; - if(!tokenizer.hasMoreTokens()) { + if (!tokenizer.hasMoreTokens()) { throw new ImagingException("PAM header has no MAXVAL value"); } maxVal = Integer.parseInt(tokenizer.nextToken()); } else if ("TUPLTYPE".equals(type)) { seenTupleType = true; - if(!tokenizer.hasMoreTokens()) { + if (!tokenizer.hasMoreTokens()) { throw new ImagingException("PAM header has no TUPLTYPE value"); } tupleType.append(tokenizer.nextToken()); diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffRasterData.java b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffRasterData.java index 4bf28440..dfe51fa3 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffRasterData.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffRasterData.java @@ -60,7 +60,7 @@ public abstract class TiffRasterData { throw new IllegalArgumentException( "Raster dimensions less than or equal to zero are not supported"); } - if(samplesPerPixel <= 0){ + if (samplesPerPixel <= 0){ throw new IllegalArgumentException( "Raster samples-per-pixel specification must be at least 1"); } diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/write/AbstractTiffImageWriter.java b/src/main/java/org/apache/commons/imaging/formats/tiff/write/AbstractTiffImageWriter.java index a5442a4f..52aeb9ac 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/write/AbstractTiffImageWriter.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/write/AbstractTiffImageWriter.java @@ -186,12 +186,12 @@ public abstract class AbstractTiffImageWriter { bitCache = 0; bitsInCache = 0; } - } else if(samplesPerPixel==4){ + } else if (samplesPerPixel==4){ uncompressed[counter++] = (byte) red; uncompressed[counter++] = (byte) green; uncompressed[counter++] = (byte) blue; uncompressed[counter++] = (byte) (rgb>>24); - }else { + } else { // samples per pixel is 3 uncompressed[counter++] = (byte) red; uncompressed[counter++] = (byte) green; @@ -645,7 +645,7 @@ public abstract class AbstractTiffImageWriter { directory.add(TiffTagConstants.TIFF_TAG_XMP, xmpXmlBytes); } - if(predictor==TiffTagConstants.PREDICTOR_VALUE_HORIZONTAL_DIFFERENCING){ + if (predictor == TiffTagConstants.PREDICTOR_VALUE_HORIZONTAL_DIFFERENCING){ directory.add(TiffTagConstants.TIFF_TAG_PREDICTOR, predictor); } diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java index 63cc8dad..6ce23373 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java @@ -757,7 +757,7 @@ public final class TiffOutputDirectory extends AbstractTiffOutputItem implements // Debug.debug("\t" + "writing field (" + field.tag + ", 0x" + // Integer.toHexString(field.tag) + ")", field.tagInfo); - // if(field.tagInfo.isOffset()) + // if (field.tagInfo.isOffset()) // Debug.debug("\t\tOFFSET!", field.bytes); } diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java index 754763d9..767a6a42 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java @@ -82,7 +82,7 @@ public class TiffOutputField { } protected void setData(final byte[] bytes) throws ImagingException { - // if(tagInfo.isUnknown()) + // if (tagInfo.isUnknown()) // Debug.debug("unknown tag(0x" + Integer.toHexString(tag) // + ") setData", bytes); diff --git a/src/test/java/org/apache/commons/imaging/examples/tiff/ReadTagsAndImages.java b/src/test/java/org/apache/commons/imaging/examples/tiff/ReadTagsAndImages.java index 98005dc2..e5879595 100644 --- a/src/test/java/org/apache/commons/imaging/examples/tiff/ReadTagsAndImages.java +++ b/src/test/java/org/apache/commons/imaging/examples/tiff/ReadTagsAndImages.java @@ -86,8 +86,8 @@ public class ReadTagsAndImages { * otherwise, a null. */ static CoordinateTransformationCode getValueForKey(final int key){ - for(final CoordinateTransformationCode v: values()){ - if(v.key==key){ + for (final CoordinateTransformationCode v: values()){ + if (v.key==key){ return v; } } @@ -313,14 +313,14 @@ public class ReadTagsAndImages { } break; case ProjectionGeoKey: - if(valueOrPosition==32767){ + if (valueOrPosition==32767){ return "User-Defined"; } break; case ProjCoordTransGeoKey: final CoordinateTransformationCode code = CoordinateTransformationCode.getValueForKey(valueOrPosition); - if(code!=null){ + if (code!=null){ return code.name(); } break; diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointMultivariableTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointMultivariableTest.java index 96e3ceda..eb2d7f43 100644 --- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointMultivariableTest.java +++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointMultivariableTest.java @@ -133,7 +133,7 @@ public class TiffFloatingPointMultivariableTest extends TiffBaseTest { final int nBlocks = nRowsOfBlocks * nColsOfBlocks; final int nBytesInBlock = bytesPerPixel * nRowsInBlock * nColsInBlock; final byte[][] blocks = new byte[nBlocks][nBytesInBlock]; - if(planarConfiguration == TiffPlanarConfiguration.CHUNKY){ + if (planarConfiguration == TiffPlanarConfiguration.CHUNKY){ for (int i = 0; i < height; i++) { final int blockRow = i / nRowsInBlock; final int rowInBlock = i - blockRow * nRowsInBlock; @@ -159,12 +159,12 @@ public class TiffFloatingPointMultivariableTest extends TiffBaseTest { } } } - }else{ + } else { for (int i = 0; i < height; i++) { final int blockRow = i / nRowsInBlock; final int rowInBlock = i - blockRow * nRowsInBlock; int blockPlanarOffset = nRowsInBlock*nColsInBlock; - if(!useTiles && (blockRow+1)*nRowsInBlock>height){ + if (!useTiles && (blockRow+1)*nRowsInBlock>height){ // For TIFF files using the Strip format, the convention // is to not include any extra padding in the data. So if the // height of the image is not evenly divided by the number @@ -300,7 +300,7 @@ public class TiffFloatingPointMultivariableTest extends TiffBaseTest { outDir.add(TiffTagConstants.TIFF_TAG_COMPRESSION, (short) TiffTagConstants.COMPRESSION_VALUE_UNCOMPRESSED); - if(useTiles && usePredictorForTiles){ + if (useTiles && usePredictorForTiles) { outDir.add(TiffTagConstants.TIFF_TAG_PREDICTOR, (short) TiffTagConstants.PREDICTOR_VALUE_FLOATING_POINT_DIFFERENCING); for (final byte[] block : blocks) { @@ -308,7 +308,7 @@ public class TiffFloatingPointMultivariableTest extends TiffBaseTest { } } - if(planarConfiguration==TiffPlanarConfiguration.CHUNKY){ + if (planarConfiguration==TiffPlanarConfiguration.CHUNKY) { outDir.add(TiffTagConstants.TIFF_TAG_PLANAR_CONFIGURATION, (short) TiffTagConstants.PLANAR_CONFIGURATION_VALUE_CHUNKY); }else{ 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 13723efe..8cc12073 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 @@ -62,7 +62,7 @@ public class TiffReadTest extends TiffBaseTest { // the "bad offsets" file will cause an exception to be thrown. // It's not relevant to what this test is trying to discover. // So skip it. - if(name.toLowerCase().contains("bad")){ + if (name.toLowerCase().contains("bad")) { continue; } final ByteSource byteSource = ByteSource.file(imageFile); diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java index bce6029e..d3952bdc 100644 --- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java +++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java @@ -95,7 +95,7 @@ public class TiffSubImageTest extends TiffBaseTest { final BufferedImage referenceImage = Imaging.getBufferedImage(target); final int rW = referenceImage.getWidth(); final int rH = referenceImage.getHeight(); - if(rW<3 || rH<3){ + if (rW<3 || rH<3) { continue; } final int []rArgb = new int[rW*rH];