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 2023/08/23 12:46:47 UTC
[commons-imaging] branch master updated: Normalize array type declarations
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 8ac06bad Normalize array type declarations
8ac06bad is described below
commit 8ac06bad351b031cba941cf95b99025c3431c687
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 23 08:46:42 2023 -0400
Normalize array type declarations
---
.../org/apache/commons/imaging/ColorTools.java | 2 +-
.../imaging/formats/bmp/BmpImageParser.java | 4 ++--
.../imaging/formats/gif/GifImageParser.java | 2 +-
.../imaging/formats/jpeg/JpegImageParser.java | 2 +-
.../imaging/formats/jpeg/xmp/JpegRewriter.java | 4 ++--
.../formats/png/ScanExpediterInterlaced.java | 4 ++--
.../imaging/formats/psd/PsdImageParser.java | 24 +++++++++++-----------
.../commons/imaging/formats/tiff/TiffField.java | 4 ++--
.../imaging/formats/tiff/TiffImageMetadata.java | 2 +-
.../imaging/formats/tiff/TiffImageParser.java | 8 ++++----
.../imaging/examples/tiff/ReadTagsAndImages.java | 2 +-
11 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/ColorTools.java b/src/main/java/org/apache/commons/imaging/ColorTools.java
index a6a692af..d6535852 100644
--- a/src/main/java/org/apache/commons/imaging/ColorTools.java
+++ b/src/main/java/org/apache/commons/imaging/ColorTools.java
@@ -198,7 +198,7 @@ public class ColorTools {
// // int old_mask = dcm.getRedMask() | dcm.getGreenMask()
// // | dcm.getBlueMask() | dcm.getAlphaMask();
//
- // int old_masks[] = pcm.getMasks();
+ // int[] old_masks = pcm.getMasks();
// // System.out.println("old_mask: " + old_mask);
// int old_bits = countBitsInMask(old_masks);
// // System.out.println("old_bits: " + old_bits);
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
index 4394ea63..0a0f8746 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
@@ -126,8 +126,8 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
final BmpImageContents ic = readImageContents(inputStream, FormatCompliance.getDefault());
final BmpHeaderInfo bhi = ic.bhi;
- // byte colorTable[] = ic.colorTable;
- // byte imageData[] = ic.imageData;
+ // byte[] colorTable = ic.colorTable;
+ // byte[] imageData = ic.imageData;
final int width = bhi.width;
final int height = bhi.height;
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java b/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
index 3302fb56..5640f428 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
@@ -938,7 +938,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
final int maxColors = hasAlpha ? 255 : 256;
Palette palette2 = new PaletteFactory().makeExactRgbPaletteSimple(src, maxColors);
- // int palette[] = new PaletteFactory().makePaletteSimple(src, 256);
+ // int[] palette = new PaletteFactory().makePaletteSimple(src, 256);
// Map palette_map = paletteToMap(palette);
if (palette2 == null) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
index 4a079859..a8121883 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
@@ -275,7 +275,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
final GenericSegment segment = (GenericSegment) exifSegments.get(0);
final byte[] bytes = segment.getSegmentData();
- // byte head[] = readBytearray("exif head", bytes, 0, 6);
+ // byte[] head = readBytearray("exif head", bytes, 0, 6);
//
// Debug.debug("head", head);
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java
index d71a222d..0ac8f597 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java
@@ -300,13 +300,13 @@ public class JpegRewriter extends BinaryFileParser {
// private void writeSegment(OutputStream os, JFIFPieceSegment piece)
// throws ImageWriteException, IOException
// {
- // byte markerBytes[] = convertShortToByteArray(JPEG_APP1_MARKER,
+ // byte[] markerBytes = convertShortToByteArray(JPEG_APP1_MARKER,
// JPEG_BYTE_ORDER);
// if (piece.segmentData.length > 0xffff)
// throw new JpegSegmentOverflowException("JPEG segment is too long: "
// + piece.segmentData.length);
// int segmentLength = piece.segmentData.length + 2;
- // byte segmentLengthBytes[] = convertShortToByteArray(segmentLength,
+ // byte[] segmentLengthBytes = convertShortToByteArray(segmentLength,
// JPEG_BYTE_ORDER);
//
// os.write(markerBytes);
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterInterlaced.java b/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterInterlaced.java
index da67e543..b451740c 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterInterlaced.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterInterlaced.java
@@ -29,8 +29,8 @@ class ScanExpediterInterlaced extends AbstractScanExpediter {
private static final int[] STARTING_COL = { 0, 4, 0, 2, 0, 1, 0 };
private static final int[] ROW_INCREMENT = { 8, 8, 8, 4, 4, 2, 2 };
private static final int[] COL_INCREMENT = { 8, 8, 4, 4, 2, 2, 1 };
-// private static final int Block_Height[] = { 8, 8, 4, 4, 2, 2, 1 };
-// private static final int Block_Width[] = { 8, 4, 4, 2, 2, 1, 1 };
+// private static final int[] Block_Height = { 8, 8, 4, 4, 2, 2, 1 };
+// private static final int[] Block_Width = { 8, 4, 4, 2, 2, 1, 1 };
ScanExpediterInterlaced(final int width, final int height, final InputStream is,
final BufferedImage bi,
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java b/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
index 4c83ecd5..410be712 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
@@ -268,7 +268,7 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
}
skipBytes(is, colorModeDataLength);
- // byte ColorModeData[] = readByteArray("ColorModeData",
+ // byte[] ColorModeData = readByteArray("ColorModeData",
// ColorModeDataLength, is, "Not a Valid PSD File");
final int imageResourcesLength = read4Bytes("ImageResourcesLength", is,
@@ -280,7 +280,7 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
}
skipBytes(is, imageResourcesLength);
- // byte ImageResources[] = readByteArray("ImageResources",
+ // byte[] ImageResources = readByteArray("ImageResources",
// ImageResourcesLength, is, "Not a Valid PSD File");
final int layerAndMaskDataLength = read4Bytes("LayerAndMaskDataLength",
@@ -292,12 +292,12 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
}
skipBytes(is, layerAndMaskDataLength);
- // byte LayerAndMaskData[] = readByteArray("LayerAndMaskData",
+ // byte[] LayerAndMaskData = readByteArray("LayerAndMaskData",
// LayerAndMaskDataLength, is, "Not a Valid PSD File");
read2Bytes("Compression", is, "Not a Valid PSD File", getByteOrder());
- // byte ImageData[] = readByteArray("ImageData",
+ // byte[] ImageData = readByteArray("ImageData",
// LayerAndMaskDataLength, is, "Not a Valid PSD File");
// if (section == kPSD_SECTION_IMAGE_DATA)
@@ -430,7 +430,7 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
}
skipBytes(is, colorModeDataLength);
- // byte ColorModeData[] = readByteArray("ColorModeData",
+ // byte[] ColorModeData = readByteArray("ColorModeData",
// ColorModeDataLength, is, "Not a Valid PSD File");
final int imageResourcesLength = read4Bytes("ImageResourcesLength", is, "Not a Valid PSD File", getByteOrder());
@@ -440,7 +440,7 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
}
skipBytes(is, imageResourcesLength);
- // byte ImageResources[] = readByteArray("ImageResources",
+ // byte[] ImageResources = readByteArray("ImageResources",
// ImageResourcesLength, is, "Not a Valid PSD File");
final int layerAndMaskDataLength = read4Bytes("LayerAndMaskDataLength", is, "Not a Valid PSD File", getByteOrder());
@@ -450,12 +450,12 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
}
skipBytes(is, layerAndMaskDataLength);
- // byte LayerAndMaskData[] = readByteArray("LayerAndMaskData",
+ // byte[] LayerAndMaskData = readByteArray("LayerAndMaskData",
// LayerAndMaskDataLength, is, "Not a Valid PSD File");
read2Bytes("Compression", is, "Not a Valid PSD File", getByteOrder());
- // byte ImageData[] = readByteArray("ImageData",
+ // byte[] ImageData = readByteArray("ImageData",
// LayerAndMaskDataLength, is, "Not a Valid PSD File");
if (section == PSD_SECTION_IMAGE_DATA) {
@@ -587,27 +587,27 @@ public class PsdImageParser extends AbstractImageParser<PsdImagingParameters> im
"Not a Valid PSD File", getByteOrder());
skipBytes(is, colorModeDataLength);
// is.skip(ColorModeDataLength);
- // byte ColorModeData[] = readByteArray("ColorModeData",
+ // byte[] ColorModeData = readByteArray("ColorModeData",
// ColorModeDataLength, is, "Not a Valid PSD File");
final int imageResourcesLength = read4Bytes("ImageResourcesLength", is,
"Not a Valid PSD File", getByteOrder());
skipBytes(is, imageResourcesLength);
// long skipped = is.skip(ImageResourcesLength);
- // byte ImageResources[] = readByteArray("ImageResources",
+ // byte[] ImageResources = readByteArray("ImageResources",
// ImageResourcesLength, is, "Not a Valid PSD File");
final int layerAndMaskDataLength = read4Bytes("LayerAndMaskDataLength", is,
"Not a Valid PSD File", getByteOrder());
skipBytes(is, layerAndMaskDataLength);
// is.skip(LayerAndMaskDataLength);
- // byte LayerAndMaskData[] = readByteArray("LayerAndMaskData",
+ // byte[] LayerAndMaskData = readByteArray("LayerAndMaskData",
// LayerAndMaskDataLength, is, "Not a Valid PSD File");
final int compression = read2Bytes("Compression", is, "Not a Valid PSD File", getByteOrder());
// skip_bytes(is, LayerAndMaskDataLength);
- // byte ImageData[] = readByteArray("ImageData", LayerAndMaskDataLength,
+ // byte[] ImageData = readByteArray("ImageData", LayerAndMaskDataLength,
// is, "Not a Valid PSD File");
// System.out.println("Compression: " + Compression);
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
index 57ef906c..e0701a9f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
@@ -387,7 +387,7 @@ public class TiffField {
return result.toString();
// } else if (o instanceof Number[])
// {
- // Number numbers[] = (Number[]) o;
+ // Number[] numbers = (Number[]) o;
// StringBuilder result = new StringBuilder();
//
// for (int i = 0; i < numbers.length; i++)
@@ -529,7 +529,7 @@ public class TiffField {
}
// else if (o instanceof short[])
// {
- // short numbers[] = (short[]) o;
+ // short[] numbers = (short[]) o;
// StringBuilder result = new StringBuilder();
//
// for (int i = 0; i < numbers.length; i++)
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
index c1568fba..84f835c4 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
@@ -101,7 +101,7 @@ public class TiffImageMetadata extends GenericImageMetadata {
final TagInfo tagInfo = srcField.getTagInfo();
final AbstractFieldType abstractFieldType = srcField.getFieldType();
- // byte bytes[] = srcField.fieldType.getRawBytes(srcField);
+ // byte[] bytes = srcField.fieldType.getRawBytes(srcField);
// Debug.debug("tagInfo", tagInfo);
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 67147915..c2af18d7 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
@@ -672,18 +672,18 @@ public class TiffImageParser extends AbstractImageParser<TiffImagingParameters>
return new PhotometricInterpreterCmyk(samplesPerPixel,
bitsPerSample, predictor, width, height);
case 6: {
-// final double yCbCrCoefficients[] = directory.findField(
+// final double[] yCbCrCoefficients = directory.findField(
// TiffTagConstants.TIFF_TAG_YCBCR_COEFFICIENTS, true)
// .getDoubleArrayValue();
//
-// final int yCbCrPositioning[] = directory.findField(
+// final int[] yCbCrPositioning = directory.findField(
// TiffTagConstants.TIFF_TAG_YCBCR_POSITIONING, true)
// .getIntArrayValue();
-// final int yCbCrSubSampling[] = directory.findField(
+// final int[] yCbCrSubSampling = directory.findField(
// TiffTagConstants.TIFF_TAG_YCBCR_SUB_SAMPLING, true)
// .getIntArrayValue();
//
-// final double referenceBlackWhite[] = directory.findField(
+// final double[] referenceBlackWhite = directory.findField(
// TiffTagConstants.TIFF_TAG_REFERENCE_BLACK_WHITE, true)
// .getDoubleArrayValue();
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 e5879595..00607e8e 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
@@ -507,7 +507,7 @@ public class ReadTagsAndImages {
}
if (contentTypeString != null) {
ps.format("%nContent Type: %s", contentTypeString);
- final String gdalNoDataString[] = directory.getFieldValue(
+ final String[] gdalNoDataString = directory.getFieldValue(
GdalLibraryTagConstants.EXIF_TAG_GDAL_NO_DATA, false);
if (gdalNoDataString != null && gdalNoDataString.length > 0) {
ps.format(" GDAL No-Data value: %s", gdalNoDataString[0]);