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/07/04 19:21:24 UTC
[commons-imaging] branch master updated (4592191a -> bf27ed87)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git
from 4592191a Use Java naming conventions
new e085ffa3 Better name
new ba04cbee Better name
new 83f19761 Use Java camel-case naming conventions
new 69d24d4c Use Java camel-case naming conventions
new 6cdb19b3 Use Java camel-case naming conventions
new 12234c2a Use Java camel-case naming conventions
new 029195f4 Use Java camel-case naming conventions
new be4b44bc Use Java camel-case naming conventions
new aec1e56d Use Java camel-case naming conventions
new 5d123749 Use Java camel-case naming conventions
new 59234d03 Use Java camel-case naming conventions
new d6a505c2 Use Java camel-case naming conventions
new e00dcdfa Use Java camel-case naming conventions
new ee62b8a3 Use Java camel-case naming conventions
new 5cf32823 Use Java camel-case naming conventions
new 211eaac5 Use Java camel-case naming conventions
new 3ce9e32c Use Java camel-case naming conventions
new 9896e596 Use Java camel-case naming conventions
new 89e86234 Use Java camel-case naming conventions
new ee0f0620 Use Java camel-case naming conventions
new 9a4f24b3 Use Java camel-case naming conventions
new c6399d90 Use Java camel-case naming conventions
new af1f5def Use Java camel-case naming conventions
new ed457644 Use Java camel-case naming conventions
new 8a942712 Use Java camel-case naming conventions
new 21858572 Use Java camel-case naming conventions
new 0d03445a Use Java camel-case naming conventions
new 157cc8fa Use Java camel-case naming conventions
new 39bb6b3b Use Java camel-case naming conventions
new 65e196bc Use Java camel-case naming conventions
new 5baa945b Use Java camel-case naming conventions
new c462d240 Use Java camel-case naming conventions
new bf27ed87 No need to initialize to default value
The 33 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/commons/imaging/ImageParser.java | 18 ++++----
.../java/org/apache/commons/imaging/Imaging.java | 2 +-
.../commons/imaging/common/BinaryFunctions.java | 2 +-
.../commons/imaging/common/ImageBuilder.java | 4 +-
.../imaging/formats/bmp/BmpImageParser.java | 6 +--
.../commons/imaging/formats/bmp/PixelParser.java | 2 +-
.../imaging/formats/bmp/PixelParserBitFields.java | 2 +-
.../imaging/formats/bmp/PixelParserRgb.java | 6 +--
.../imaging/formats/bmp/PixelParserRle.java | 8 ++--
.../imaging/formats/bmp/PixelParserSimple.java | 6 +--
.../imaging/formats/dcx/DcxImageParser.java | 2 +-
.../imaging/formats/gif/GifImageParser.java | 20 ++++-----
.../commons/imaging/formats/icns/IcnsDecoder.java | 14 +++---
.../imaging/formats/icns/IcnsImageParser.java | 2 +-
.../imaging/formats/ico/IcoImageParser.java | 2 +-
.../imaging/formats/jpeg/JpegImageMetadata.java | 12 +++---
.../imaging/formats/jpeg/JpegImageParser.java | 46 ++++++++++----------
.../commons/imaging/formats/jpeg/JpegUtils.java | 18 ++++----
.../commons/imaging/formats/jpeg/decoder/Dct.java | 8 ++--
.../imaging/formats/jpeg/decoder/JpegDecoder.java | 22 +++++-----
.../formats/jpeg/decoder/YCbCrConverter.java | 2 +-
.../imaging/formats/jpeg/exif/ExifRewriter.java | 14 +++---
.../imaging/formats/jpeg/iptc/IptcBlock.java | 2 +-
.../imaging/formats/jpeg/iptc/IptcParser.java | 8 ++--
.../formats/jpeg/iptc/JpegIptcRewriter.java | 50 +++++++++++-----------
.../formats/jpeg/iptc/PhotoshopApp13Data.java | 2 +-
.../imaging/formats/jpeg/xmp/JpegRewriter.java | 8 ++--
.../imaging/formats/jpeg/xmp/JpegXmpRewriter.java | 4 +-
.../imaging/formats/pcx/PcxImageParser.java | 2 +-
.../imaging/formats/png/GammaCorrection.java | 2 +-
.../imaging/formats/png/PngImageParser.java | 4 +-
.../commons/imaging/formats/png/ScanExpediter.java | 26 +++++------
.../formats/png/ScanExpediterInterlaced.java | 2 +-
.../imaging/formats/png/ScanExpediterSimple.java | 2 +-
.../imaging/formats/png/chunks/PngChunkPlte.java | 2 +-
.../commons/imaging/formats/pnm/FileInfo.java | 14 +++---
.../commons/imaging/formats/pnm/PamFileInfo.java | 14 +++---
.../commons/imaging/formats/pnm/PbmFileInfo.java | 6 +--
.../commons/imaging/formats/pnm/PgmFileInfo.java | 6 +--
.../imaging/formats/pnm/PnmImageParser.java | 4 +-
.../commons/imaging/formats/pnm/PpmFileInfo.java | 6 +--
.../imaging/formats/psd/PsdImageParser.java | 2 +-
.../formats/psd/dataparsers/DataParser.java | 4 +-
.../formats/psd/dataparsers/DataParserBitmap.java | 2 +-
.../formats/psd/dataparsers/DataParserCmyk.java | 2 +-
.../psd/dataparsers/DataParserGrayscale.java | 2 +-
.../formats/psd/dataparsers/DataParserIndexed.java | 2 +-
.../formats/psd/dataparsers/DataParserLab.java | 2 +-
.../formats/psd/dataparsers/DataParserRgb.java | 2 +-
.../formats/psd/dataparsers/DataParserStub.java | 2 +-
.../imaging/formats/rgbe/RgbeImageParser.java | 2 +-
.../imaging/formats/tiff/TiffImageMetadata.java | 8 ++--
.../imaging/formats/tiff/TiffImageParser.java | 2 +-
.../constants/AdobePageMaker6TagConstants.java | 4 +-
.../formats/tiff/datareaders/DataReaderStrips.java | 4 +-
.../formats/tiff/datareaders/DataReaderTiled.java | 4 +-
.../formats/tiff/itu_t4/T4AndT6Compression.java | 6 +--
.../PhotometricInterpreterBiLevel.java | 2 +-
.../PhotometricInterpreterCieLab.java | 2 +-
.../PhotometricInterpreterCmyk.java | 2 +-
.../PhotometricInterpreterLogLuv.java | 2 +-
.../PhotometricInterpreterPalette.java | 2 +-
.../PhotometricInterpreterRgb.java | 2 +-
.../PhotometricInterpreterYCbCr.java | 2 +-
.../floatingpoint/PaletteEntry.java | 2 +-
.../floatingpoint/PaletteEntryForRange.java | 2 +-
.../floatingpoint/PaletteEntryForValue.java | 2 +-
.../floatingpoint/PhotometricInterpreterFloat.java | 16 +++----
...TagInfoLongOrIFD.java => TagInfoLongOrIfd.java} | 6 +--
.../imaging/formats/tiff/write/TiffOutputSet.java | 12 +++---
.../imaging/formats/wbmp/WbmpImageParser.java | 2 +-
.../imaging/formats/xbm/XbmImageParser.java | 2 +-
.../imaging/formats/xpm/XpmImageParser.java | 20 ++++-----
.../commons/imaging/icc/IccProfileParser.java | 18 ++++----
.../commons/imaging/common/ImageBuilderTest.java | 8 ++--
.../commons/imaging/examples/MetadataExample.java | 12 +++---
.../imaging/examples/WriteExifMetadataExample.java | 4 +-
.../tiff/ExampleReadFloatingPointData.java | 2 +-
.../formats/jpeg/JpegWithJpegThumbnailTest.java | 2 +-
.../imaging/formats/jpeg/decoder/DctTest.java | 8 ++--
.../imaging/formats/jpeg/exif/ExifDumpTest.java | 2 +-
.../imaging/formats/jpeg/exif/ExifRewriteTest.java | 14 +++---
.../commons/imaging/formats/jpeg/exif/GpsTest.java | 2 +-
.../formats/jpeg/exif/MicrosoftTagTest.java | 2 +-
.../imaging/formats/jpeg/iptc/IptcAddTest.java | 2 +-
.../formats/jpeg/iptc/IptcFullDiscardTest.java | 4 +-
.../imaging/formats/jpeg/iptc/IptcUpdateTest.java | 6 +--
.../imaging/formats/pnm/PbmFileInfoTest.java | 2 +-
.../tiff/TiffFloatingPointRoundTripTest.java | 2 +-
.../PhotometricInterpreterLogLuvTest.java | 2 +-
.../PhotometricInterpreterRgbTest.java | 2 +-
.../floatingpoint/PaletteEntryForRangeTest.java | 4 +-
.../floatingpoint/PaletteEntryForValueTest.java | 10 ++---
.../PhotometricInterpreterFloatTest.java | 18 ++++----
.../formats/tiff/write/TiffOutputSetTest.java | 2 +-
95 files changed, 319 insertions(+), 319 deletions(-)
rename src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/{TagInfoLongOrIFD.java => TagInfoLongOrIfd.java} (90%)
[commons-imaging] 30/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 65e196bc51df96d37e16a9faf84b0cdb69ad2c97
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:17:55 2023 -0400
Use Java camel-case naming conventions
---
.../apache/commons/imaging/formats/tiff/TiffImageMetadata.java | 8 ++++----
.../java/org/apache/commons/imaging/examples/MetadataExample.java | 2 +-
.../org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
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 db34514b..d28d7d70 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
@@ -154,7 +154,7 @@ public class TiffImageMetadata extends GenericImageMetadata {
}
- public static class GPSInfo {
+ public static class GpsInfo {
public final String latitudeRef;
public final String longitudeRef;
@@ -165,7 +165,7 @@ public class TiffImageMetadata extends GenericImageMetadata {
public final RationalNumber longitudeMinutes;
public final RationalNumber longitudeSeconds;
- public GPSInfo(final String latitudeRef, final String longitudeRef,
+ public GpsInfo(final String latitudeRef, final String longitudeRef,
final RationalNumber latitudeDegrees,
final RationalNumber latitudeMinutes,
final RationalNumber latitudeSeconds,
@@ -491,7 +491,7 @@ public class TiffImageMetadata extends GenericImageMetadata {
return tag.getValue(field);
}
- public GPSInfo getGPS() throws ImagingException {
+ public GpsInfo getGPS() throws ImagingException {
final TiffDirectory gpsDirectory = findDirectory(TiffDirectoryConstants.DIRECTORY_TYPE_GPS);
if (null == gpsDirectory) {
return null;
@@ -526,7 +526,7 @@ public class TiffImageMetadata extends GenericImageMetadata {
final RationalNumber longitudeMinutes = longitude[1];
final RationalNumber longitudeSeconds = longitude[2];
- return new GPSInfo(latitudeRef, longitudeRef, latitudeDegrees,
+ return new GpsInfo(latitudeRef, longitudeRef, latitudeDegrees,
latitudeMinutes, latitudeSeconds, longitudeDegrees,
longitudeMinutes, longitudeSeconds);
}
diff --git a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
index ba30e957..26469e6e 100644
--- a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
+++ b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
@@ -78,7 +78,7 @@ public class MetadataExample {
// simple interface to GPS data
final TiffImageMetadata exifMetadata = jpegMetadata.getExif();
if (null != exifMetadata) {
- final TiffImageMetadata.GPSInfo gpsInfo = exifMetadata.getGPS();
+ final TiffImageMetadata.GpsInfo gpsInfo = exifMetadata.getGPS();
if (null != gpsInfo) {
final String gpsDescription = gpsInfo.toString();
final double longitude = gpsInfo.getLongitudeAsDegreesEast();
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
index b1e9d693..1432178e 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
@@ -50,7 +50,7 @@ public class GpsTest extends ExifBaseTest {
return;
}
- final TiffImageMetadata.GPSInfo gpsInfo = exifMetadata.getGPS();
+ final TiffImageMetadata.GpsInfo gpsInfo = exifMetadata.getGPS();
if (null == gpsInfo) {
return;
}
[commons-imaging] 12/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 d6a505c2fb1eb2458c0431b8b9b52b12d5a79c15
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:57:11 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java | 2 +-
.../java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java | 2 +-
.../apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
index 83df77c3..bea1d350 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
@@ -48,7 +48,7 @@ public class IptcBlock {
return blockType;
}
- public boolean isIPTCBlock() {
+ public boolean isIptcBlock() {
return blockType == IptcConstants.IMAGE_RESOURCE_BLOCK_IPTC_DATA;
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
index 9fd1b309..38d1be2a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
@@ -343,7 +343,7 @@ public class IptcParser extends BinaryFileParser {
for (final IptcBlock block : blocks) {
// Ignore everything but IPTC data.
- if (!block.isIPTCBlock()) {
+ if (!block.isIptcBlock()) {
continue;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java
index 9a13cafa..69fdf8db 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java
@@ -34,7 +34,7 @@ public class PhotoshopApp13Data {
public List<IptcBlock> getNonIptcBlocks() {
final List<IptcBlock> result = new ArrayList<>();
for (final IptcBlock block : rawBlocks) {
- if (!block.isIPTCBlock()) {
+ if (!block.isIptcBlock()) {
result.add(block);
}
}
[commons-imaging] 10/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 5d123749b5cf492a133479e0aba84c3721b2afe2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:55:05 2023 -0400
Use Java camel-case naming conventions
---
.../org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java | 2 +-
.../org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index 7a342f5e..bac123f3 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -510,7 +510,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
final int y = scaledMCU[0].samples[srcRowOffset + x2];
final int cb = scaledMCU[1].samples[srcRowOffset + x2];
final int cr = scaledMCU[2].samples[srcRowOffset + x2];
- final int rgb = YCbCrConverter.convertYCbCrToRGB(y,
+ final int rgb = YCbCrConverter.convertYCbCrToRgb(y,
cb, cr);
dataBuffer.setElem(dstRowOffset + x2, rgb);
} else if (mcu.length == 1) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java
index 7c98bb00..99c977aa 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java
@@ -99,7 +99,7 @@ final class YCbCrConverter {
}
}
- public static int convertYCbCrToRGB(final int y, final int cb, final int cr) {
+ public static int convertYCbCrToRgb(final int y, final int cb, final int cr) {
final int r = REDS[(cr << 8) | y];
final int g1 = GREENS1[(cb << 8) | cr];
final int g = GREENS2[(g1 << 8) | y];
[commons-imaging] 18/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 9896e5966b5e526136406853b629b240fa28733e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:03:52 2023 -0400
Use Java camel-case naming conventions
---
.../commons/imaging/formats/jpeg/JpegImageMetadata.java | 12 ++++++------
.../apache/commons/imaging/formats/jpeg/JpegImageParser.java | 6 +++---
.../org/apache/commons/imaging/examples/MetadataExample.java | 10 +++++-----
.../imaging/formats/jpeg/JpegWithJpegThumbnailTest.java | 2 +-
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
index 325e9e50..1454e16e 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
@@ -50,7 +50,7 @@ public class JpegImageMetadata implements ImageMetadata {
Debug.debug(this.toString());
}
- public TiffField findEXIFValue(final TagInfo tagInfo) {
+ public TiffField findExifValue(final TagInfo tagInfo) {
try {
return exif != null ? exif.findField(tagInfo) : null;
} catch (final ImagingException cannotHappen) {
@@ -58,7 +58,7 @@ public class JpegImageMetadata implements ImageMetadata {
}
}
- public TiffField findEXIFValueWithExactMatch(final TagInfo tagInfo) {
+ public TiffField findExifValueWithExactMatch(final TagInfo tagInfo) {
try {
return exif != null ? exif.findField(tagInfo, true) : null;
} catch (final ImagingException cannotHappen) {
@@ -78,7 +78,7 @@ public class JpegImageMetadata implements ImageMetadata {
* @throws ImagingException if it fails to read the image
* @throws IOException if it fails to get the thumbnail or to read the image data
*/
- public BufferedImage getEXIFThumbnail() throws ImagingException,
+ public BufferedImage getExifThumbnail() throws ImagingException,
IOException {
if (exif == null) {
@@ -125,7 +125,7 @@ public class JpegImageMetadata implements ImageMetadata {
*
* @return JPEG data or null if no thumbnail.
*/
- public byte[] getEXIFThumbnailData() {
+ public byte[] getExifThumbnailData() {
if (exif == null) {
return null;
}
@@ -154,9 +154,9 @@ public class JpegImageMetadata implements ImageMetadata {
* @throws ImagingException if it fails to read the image
* @throws IOException if it fails to read the image size
*/
- public Dimension getEXIFThumbnailSize() throws ImagingException,
+ public Dimension getExifThumbnailSize() throws ImagingException,
IOException {
- final byte[] data = getEXIFThumbnailData();
+ final byte[] data = getExifThumbnailData();
if (data != null) {
return Imaging.getImageSize(data);
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 848e9ef5..9e90beb1 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
@@ -408,19 +408,19 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
if (metadata != null) {
{
- final TiffField field = metadata.findEXIFValue(TiffTagConstants.TIFF_TAG_XRESOLUTION);
+ final TiffField field = metadata.findExifValue(TiffTagConstants.TIFF_TAG_XRESOLUTION);
if (field != null) {
xDensity = ((Number) field.getValue()).doubleValue();
}
}
{
- final TiffField field = metadata.findEXIFValue(TiffTagConstants.TIFF_TAG_YRESOLUTION);
+ final TiffField field = metadata.findExifValue(TiffTagConstants.TIFF_TAG_YRESOLUTION);
if (field != null) {
yDensity = ((Number) field.getValue()).doubleValue();
}
}
{
- final TiffField field = metadata.findEXIFValue(TiffTagConstants.TIFF_TAG_RESOLUTION_UNIT);
+ final TiffField field = metadata.findExifValue(TiffTagConstants.TIFF_TAG_RESOLUTION_UNIT);
if (field != null) {
final int densityUnits = ((Number) field.getValue()).intValue();
diff --git a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
index 23452a9f..ba30e957 100644
--- a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
+++ b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
@@ -94,13 +94,13 @@ public class MetadataExample {
}
// more specific example of how to manually access GPS values
- final TiffField gpsLatitudeRefField = jpegMetadata.findEXIFValueWithExactMatch(
+ final TiffField gpsLatitudeRefField = jpegMetadata.findExifValueWithExactMatch(
GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF);
- final TiffField gpsLatitudeField = jpegMetadata.findEXIFValueWithExactMatch(
+ final TiffField gpsLatitudeField = jpegMetadata.findExifValueWithExactMatch(
GpsTagConstants.GPS_TAG_GPS_LATITUDE);
- final TiffField gpsLongitudeRefField = jpegMetadata.findEXIFValueWithExactMatch(
+ final TiffField gpsLongitudeRefField = jpegMetadata.findExifValueWithExactMatch(
GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF);
- final TiffField gpsLongitudeField = jpegMetadata.findEXIFValueWithExactMatch(
+ final TiffField gpsLongitudeField = jpegMetadata.findExifValueWithExactMatch(
GpsTagConstants.GPS_TAG_GPS_LONGITUDE);
if (gpsLatitudeRefField != null && gpsLatitudeField != null &&
gpsLongitudeRefField != null &&
@@ -150,7 +150,7 @@ public class MetadataExample {
private static void printTagValue(final JpegImageMetadata jpegMetadata,
final TagInfo tagInfo) {
- final TiffField field = jpegMetadata.findEXIFValueWithExactMatch(tagInfo);
+ final TiffField field = jpegMetadata.findExifValueWithExactMatch(tagInfo);
if (field == null) {
System.out.println(tagInfo.name + ": " + "Not Found.");
} else {
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java
index 05621e9e..ccc462be 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java
@@ -36,7 +36,7 @@ public class JpegWithJpegThumbnailTest extends ImagingTest {
final ImageMetadata metadata = Imaging.getMetadata(imageFile);
assertNotNull(metadata);
final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
- final BufferedImage image = jpegMetadata.getEXIFThumbnail();
+ final BufferedImage image = jpegMetadata.getExifThumbnail();
assertNotNull(image);
}
}
[commons-imaging] 32/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 c462d240cf2c9be040e35417183429481c8f95a6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:18:50 2023 -0400
Use Java camel-case naming conventions
---
.../org/apache/commons/imaging/formats/xpm/XpmImageParser.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java b/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
index 2437a4a8..7fd48ca8 100644
--- a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
@@ -64,7 +64,7 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
int index;
int monoArgb;
- int getBestARGB() {
+ int getBestArgb() {
if (haveColor) {
return colorArgb;
}
@@ -214,7 +214,7 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
ImageInfo.ColorType colorType = ImageInfo.ColorType.BW;
for (final Entry<Object, PaletteEntry> entry : xpmHeader.palette.entrySet()) {
final PaletteEntry paletteEntry = entry.getValue();
- if ((paletteEntry.getBestARGB() & 0xff000000) != 0xff000000) {
+ if ((paletteEntry.getBestArgb() & 0xff000000) != 0xff000000) {
transparent = true;
}
if (paletteEntry.haveColor) {
@@ -514,7 +514,7 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
final int[] palette = Allocator.intArray(xpmHeader.palette.size());
for (final Entry<Object, PaletteEntry> entry : xpmHeader.palette.entrySet()) {
final PaletteEntry paletteEntry = entry.getValue();
- palette[paletteEntry.index] = paletteEntry.getBestARGB();
+ palette[paletteEntry.index] = paletteEntry.getBestArgb();
}
colorModel = new IndexColorModel(8, xpmHeader.palette.size(), palette, 0, true, -1, DataBuffer.TYPE_BYTE);
// Check allocation
@@ -530,7 +530,7 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
final int[] palette = Allocator.intArray(xpmHeader.palette.size());
for (final Entry<Object, PaletteEntry> entry : xpmHeader.palette.entrySet()) {
final PaletteEntry paletteEntry = entry.getValue();
- palette[paletteEntry.index] = paletteEntry.getBestARGB();
+ palette[paletteEntry.index] = paletteEntry.getBestArgb();
}
colorModel = new IndexColorModel(16, xpmHeader.palette.size(), palette, 0, true, -1, DataBuffer.TYPE_USHORT);
// Check allocation
@@ -570,7 +570,7 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
if (bpp <= 16) {
dataBuffer.setElem(rowOffset + x, paletteEntry.index);
} else {
- dataBuffer.setElem(rowOffset + x, paletteEntry.getBestARGB());
+ dataBuffer.setElem(rowOffset + x, paletteEntry.getBestArgb());
}
}
}
[commons-imaging] 04/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 69d24d4cceb27c00d2b9e578d3f5bd9780ade85e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:42:40 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 d3495b9d..9beb6961 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
@@ -248,7 +248,7 @@ public class BmpImageParser extends ImageParser<BmpImagingParameters> {
return "Bmp-Custom";
}
- private byte[] getRLEBytes(final InputStream is, final int rleSamplesPerByte) throws IOException {
+ private byte[] getRleBytes(final InputStream is, final int rleSamplesPerByte) throws IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
// this.setDebug(true);
@@ -611,7 +611,7 @@ public class BmpImageParser extends ImageParser<BmpImagingParameters> {
byte[] imageData;
if (rle) {
- imageData = getRLEBytes(is, rleSamplesPerByte);
+ imageData = getRleBytes(is, rleSamplesPerByte);
} else {
imageData = readBytes("ImageData", is, imageDataSize,
"Not a Valid BMP File");
[commons-imaging] 28/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 157cc8fa47a9cb172dbb4e3d1258225cb33c1d89
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:16:07 2023 -0400
Use Java camel-case naming conventions
---
.../photometricinterpreters/floatingpoint/PaletteEntry.java | 2 +-
.../floatingpoint/PaletteEntryForRange.java | 2 +-
.../floatingpoint/PaletteEntryForValue.java | 2 +-
.../floatingpoint/PhotometricInterpreterFloat.java | 10 +++++-----
.../floatingpoint/PaletteEntryForRangeTest.java | 4 ++--
.../floatingpoint/PaletteEntryForValueTest.java | 10 +++++-----
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntry.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntry.java
index e13fa102..6f5e576f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntry.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntry.java
@@ -40,7 +40,7 @@ public interface PaletteEntry {
* @param f valid floating point value, or a NaN.
* @return an integer value
*/
- int getARGB(float f);
+ int getArgb(float f);
/**
* Gets the color assignment associated with the input value. If the input
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRange.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRange.java
index 695f7124..9ef97b56 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRange.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRange.java
@@ -113,7 +113,7 @@ public class PaletteEntryForRange implements PaletteEntry {
}
@Override
- public int getARGB(final float f) {
+ public int getArgb(final float f) {
if (v0 <= f && f <= v1) {
final float t = (f - v0) / (v1 - v0);
final int a = (int) (t * (a1 - a0) + a0 + 0.5);
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValue.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValue.java
index ce2db8e3..2d64facf 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValue.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValue.java
@@ -56,7 +56,7 @@ public class PaletteEntryForValue implements PaletteEntry {
}
@Override
- public int getARGB(final float f) {
+ public int getArgb(final float f) {
if (isNull && Float.isNaN(f)) {
return iColor;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java
index b4bd23bd..84810986 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java
@@ -225,7 +225,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
// only the single bound palette entries support NaN
for (final PaletteEntry entry : singleValuePaletteEntries) {
if (entry.isCovered(f)) {
- final int p = entry.getARGB(f);
+ final int p = entry.getArgb(f);
imageBuilder.setRgb(x, y, p);
return;
}
@@ -251,7 +251,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
for (final PaletteEntry entry : singleValuePaletteEntries) {
if (entry.isCovered(f)) {
- final int p = entry.getARGB(f);
+ final int p = entry.getArgb(f);
imageBuilder.setRgb(x, y, p);
return;
}
@@ -259,7 +259,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
for (final PaletteEntry entry : rangePaletteEntries) {
if (entry.isCovered(f)) {
- final int p = entry.getARGB(f);
+ final int p = entry.getArgb(f);
imageBuilder.setRgb(x, y, p);
break;
}
@@ -284,7 +284,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
// because NaN may have special treatment.
for (final PaletteEntry entry : singleValuePaletteEntries) {
if (entry.isCovered(f)) {
- return entry.getARGB(f);
+ return entry.getArgb(f);
}
}
@@ -296,7 +296,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
for (final PaletteEntry entry : rangePaletteEntries) {
if (entry.isCovered(f)) {
- return entry.getARGB(f);
+ return entry.getArgb(f);
}
}
return 0;
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRangeTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRangeTest.java
index 618aca4e..fbee40b2 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRangeTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForRangeTest.java
@@ -75,8 +75,8 @@ public class PaletteEntryForRangeTest {
final Color c0 = new Color(0xff0000ff);
final Color c1 = new Color(0xff00ff00);
final PaletteEntryForRange instance = new PaletteEntryForRange(0.0f, 1.0f, c0, c1);
- final int a0 = instance.getARGB(0.0f);
- final int a1 = instance.getARGB(0.5f);
+ final int a0 = instance.getArgb(0.0f);
+ final int a1 = instance.getArgb(0.5f);
assertEquals(0xff0000ff, a0, "Invalid value for 0.0f");
assertEquals(0xff008080, a1, "Invalid interpolated values");
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValueTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValueTest.java
index 47619515..58a6a311 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValueTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PaletteEntryForValueTest.java
@@ -48,15 +48,15 @@ public class PaletteEntryForValueTest {
public void testGetARGB() {
final Color c0 = new Color(0xff0000ff);
PaletteEntryForValue instance = new PaletteEntryForValue(0.0f, c0);
- int a0 = instance.getARGB(0.0f);
- int a1 = instance.getARGB(0.5f);
- final int a2 = instance.getARGB(Float.NaN);
+ int a0 = instance.getArgb(0.0f);
+ int a1 = instance.getArgb(0.5f);
+ final int a2 = instance.getArgb(Float.NaN);
assertEquals(0xff0000ff, a0, "Invalid value for target 0.0f");
assertEquals(0, a1, "Invalid value for target 0.5f");
assertEquals(0, a2, "Invalid value for target NaN");
instance = new PaletteEntryForValue(Float.NaN, c0);
- a0 = instance.getARGB(0.0f);
- a1 = instance.getARGB(Float.NaN);
+ a0 = instance.getArgb(0.0f);
+ a1 = instance.getArgb(Float.NaN);
assertEquals(0, a0, "Invalid value for target 0.0f");
assertEquals(0xff0000ff, a1, "Invalid value for target NaN");
}
[commons-imaging] 25/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 8a94271231df9eb5d657141e417159d1ab95faf1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:14:41 2023 -0400
Use Java camel-case naming conventions
---
.../apache/commons/imaging/formats/psd/dataparsers/DataParser.java | 4 ++--
.../commons/imaging/formats/psd/dataparsers/DataParserBitmap.java | 2 +-
.../commons/imaging/formats/psd/dataparsers/DataParserCmyk.java | 2 +-
.../commons/imaging/formats/psd/dataparsers/DataParserGrayscale.java | 2 +-
.../commons/imaging/formats/psd/dataparsers/DataParserIndexed.java | 2 +-
.../apache/commons/imaging/formats/psd/dataparsers/DataParserLab.java | 2 +-
.../apache/commons/imaging/formats/psd/dataparsers/DataParserRgb.java | 2 +-
.../commons/imaging/formats/psd/dataparsers/DataParserStub.java | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParser.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParser.java
index 35b6848e..afb506c6 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParser.java
@@ -25,7 +25,7 @@ import org.apache.commons.imaging.formats.psd.PsdImageContents;
public abstract class DataParser {
public abstract int getBasicChannelsCount();
- protected abstract int getRGB(int[][][] data, int x, int y, PsdImageContents imageContents);
+ protected abstract int getRgb(int[][][] data, int x, int y, PsdImageContents imageContents);
public final void parseData(final int[][][] data, final BufferedImage bi,
final PsdImageContents imageContents) {
@@ -37,7 +37,7 @@ public abstract class DataParser {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
- final int rgb = getRGB(data, x, y, imageContents);
+ final int rgb = getRgb(data, x, y, imageContents);
buffer.setElem(y * width + x, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserBitmap.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserBitmap.java
index d99e9827..63ff5aa9 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserBitmap.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserBitmap.java
@@ -26,7 +26,7 @@ public class DataParserBitmap extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y,
+ protected int getRgb(final int[][][] data, final int x, final int y,
final PsdImageContents imageContents) {
int sample = 0xff & data[0][y][x];
if (sample == 0) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserCmyk.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserCmyk.java
index 12309531..aeb14266 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserCmyk.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserCmyk.java
@@ -26,7 +26,7 @@ public class DataParserCmyk extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y,
+ protected int getRgb(final int[][][] data, final int x, final int y,
final PsdImageContents imageContents) {
int sc = 0xff & data[0][y][x];
int sm = 0xff & data[1][y][x];
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserGrayscale.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserGrayscale.java
index 071331c5..f9c451e6 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserGrayscale.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserGrayscale.java
@@ -25,7 +25,7 @@ public class DataParserGrayscale extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y,
+ protected int getRgb(final int[][][] data, final int x, final int y,
final PsdImageContents imageContents) {
final int sample = 0xff & data[0][y][x];
final int alpha = 0xff;
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserIndexed.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserIndexed.java
index ae29e935..3d2ac0a7 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserIndexed.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserIndexed.java
@@ -43,7 +43,7 @@ public class DataParserIndexed extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y, final PsdImageContents imageContents) {
+ protected int getRgb(final int[][][] data, final int x, final int y, final PsdImageContents imageContents) {
final int sample = 0xff & data[0][y][x];
return colorTable[sample];
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserLab.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserLab.java
index 765432ba..be28c3d7 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserLab.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserLab.java
@@ -27,7 +27,7 @@ public class DataParserLab extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y, final PsdImageContents imageContents) {
+ protected int getRgb(final int[][][] data, final int x, final int y, final PsdImageContents imageContents) {
final int cieL = 0xff & data[0][y][x];
int cieA = 0xff & data[1][y][x];
int cieB = 0xff & data[2][y][x];
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserRgb.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserRgb.java
index d951d7d2..96de7e09 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserRgb.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserRgb.java
@@ -25,7 +25,7 @@ public class DataParserRgb extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y,
+ protected int getRgb(final int[][][] data, final int x, final int y,
final PsdImageContents imageContents) {
final int red = 0xff & data[0][y][x];
final int green = 0xff & data[1][y][x];
diff --git a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserStub.java b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserStub.java
index 1ab32dc6..1d27205c 100644
--- a/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserStub.java
+++ b/src/main/java/org/apache/commons/imaging/formats/psd/dataparsers/DataParserStub.java
@@ -25,7 +25,7 @@ public class DataParserStub extends DataParser {
}
@Override
- protected int getRGB(final int[][][] data, final int x, final int y,
+ protected int getRgb(final int[][][] data, final int x, final int y,
final PsdImageContents imageContents) {
return 0;
}
[commons-imaging] 20/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 ee0f0620b7667595da4ede42e98c856f31445052
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:07:32 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/png/GammaCorrection.java | 2 +-
.../org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/GammaCorrection.java b/src/main/java/org/apache/commons/imaging/formats/png/GammaCorrection.java
index 8e6a7481..09e04dc4 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/GammaCorrection.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/GammaCorrection.java
@@ -41,7 +41,7 @@ public class GammaCorrection {
}
}
- public int correctARGB(final int pixel) {
+ public int correctArgb(final int pixel) {
final int alpha = (0xff000000) & pixel;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java b/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java
index 2176d243..418e8373 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java
@@ -56,7 +56,7 @@ public class PngChunkPlte extends PngChunk {
}
public void correct(final GammaCorrection gammaCorrection) {
- Arrays.setAll(rgb, i -> gammaCorrection.correctARGB(rgb[i]));
+ Arrays.setAll(rgb, i -> gammaCorrection.correctArgb(rgb[i]));
}
public int[] getRgb() {
[commons-imaging] 07/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 029195f4fcad9b0355e5ba36f55c4a03f935e262
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:52:30 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java | 8 ++++----
.../apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java | 2 +-
.../org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java | 8 ++++----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java
index 6c4227ce..21c3640a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java
@@ -101,7 +101,7 @@ final class Dct {
* "JPEG still image data compression standard", by Pennebaker and Mitchell,
* chapter 4, figure "4-8".
*/
- public static void forwardDCT8(final float[] vector) {
+ public static void forwardDct8(final float[] vector) {
final float a00 = vector[0] + vector[7];
final float a10 = vector[1] + vector[6];
final float a20 = vector[2] + vector[5];
@@ -142,7 +142,7 @@ final class Dct {
vector[3] = a74 - a43;
}
- public static void forwardDCT8x8(final float[] matrix) {
+ public static void forwardDct8x8(final float[] matrix) {
float a00, a10, a20, a30, a40, a50, a60, a70;
float a01, a11, a21, a31, neg_a41, a51, a61;
float a22, a23, mul5, a43, a53, a63;
@@ -223,7 +223,7 @@ final class Dct {
* easy equations and properly explains constants and scaling factors. Terms
* have been inlined and the negation optimized out of existence.
*/
- public static void inverseDCT8(final float[] vector) {
+ public static void inverseDct8(final float[] vector) {
// B1
final float a2 = vector[2] - vector[6];
final float a3 = vector[2] + vector[6];
@@ -270,7 +270,7 @@ final class Dct {
vector[7] = m4 - a7;
}
- public static void inverseDCT8x8(final float[] matrix) {
+ public static void inverseDct8x8(final float[] matrix) {
float a2, a3, a4, tmp1, tmp2, a5, a6, a7;
float tmp4, neg_b4, b6, b2, b5;
float tmp3, n0, n1, n2, n3, neg_n5;
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index 4520bace..ba1600b2 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -269,7 +269,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
for (int j = 0; j < 64; j++) {
block[j] = blockInt[j] * scaledQuantizationTable[j];
}
- Dct.inverseDCT8x8(block);
+ Dct.inverseDct8x8(block);
int dstRowOffset = 8 * y * 8
* frameComponent.horizontalSamplingFactor + 8 * x;
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java
index b379b2cb..bd3d9222 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java
@@ -113,7 +113,7 @@ public class DctTest {
}
final float[] data = originalData.clone();
- Dct.forwardDCT8x8(data);
+ Dct.forwardDct8x8(data);
Dct.scaleQuantizationMatrix(data);
for (int y = 0; y < 8; y++) {
for (int x = 0; x < 8; x++) {
@@ -122,7 +122,7 @@ public class DctTest {
}
Dct.scaleDequantizationMatrix(data);
- Dct.inverseDCT8x8(data);
+ Dct.inverseDct8x8(data);
for (int y = 0; y < 8; y++) {
for (int x = 0; x < 8; x++) {
assertEquals(originalData8x8[y][x], data[8 * y + x], 0.001);
@@ -144,14 +144,14 @@ public class DctTest {
}
final float[] data = originalData.clone();
- Dct.forwardDCT8(data);
+ Dct.forwardDct8(data);
Dct.scaleQuantizationVector(data);
for (int i = 0; i < 8; i++) {
assertEquals(data[i], transformed[i], 0.001);
}
Dct.scaleDequantizationVector(data);
- Dct.inverseDCT8(data);
+ Dct.inverseDct8(data);
for (int i = 0; i < 8; i++) {
assertEquals(data[i], originalData[i], 0.001);
}
[commons-imaging] 13/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 e00dcdfa38e4708a789b394529efab9a07d34d30
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:58:03 2023 -0400
Use Java camel-case naming conventions
---
.../org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java | 6 +++---
.../apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
index 38d1be2a..a1a572f3 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
@@ -212,7 +212,7 @@ public class IptcParser extends BinaryFileParser {
}
}
- protected List<IptcRecord> parseIPTCBlock(final byte[] bytes) {
+ protected List<IptcRecord> parseIptcBlock(final byte[] bytes) {
Charset charset = DEFAULT_CHARSET;
final List<IptcRecord> elements = new ArrayList<>();
@@ -347,7 +347,7 @@ public class IptcParser extends BinaryFileParser {
continue;
}
- records.addAll(parseIPTCBlock(block.getBlockData()));
+ records.addAll(parseIptcBlock(block.getBlockData()));
}
return new PhotoshopApp13Data(records, blocks);
@@ -399,7 +399,7 @@ public class IptcParser extends BinaryFileParser {
return parsePhotoshopSegment(bytes, strict);
}
- public byte[] writeIPTCBlock(List<IptcRecord> elements)
+ public byte[] writeIptcBlock(List<IptcRecord> elements)
throws ImagingException, IOException {
Charset charset = DEFAULT_CHARSET;
for (final IptcRecord element : elements) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
index fda02ed1..7cc09f51 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
@@ -300,7 +300,7 @@ public class JpegIptcRewriter extends JpegRewriter {
{
// discard old iptc blocks.
final List<IptcBlock> newBlocks = newData.getNonIptcBlocks();
- final byte[] newBlockBytes = new IptcParser().writeIPTCBlock(newData.getRecords());
+ final byte[] newBlockBytes = new IptcParser().writeIptcBlock(newData.getRecords());
final int blockType = IptcConstants.IMAGE_RESOURCE_BLOCK_IPTC_DATA;
final byte[] blockNameBytes = ImagingConstants.EMPTY_BYTE_ARRAY;
[commons-imaging] 05/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 6cdb19b32160a21de31eba901d6c525d6ba79438
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:43:21 2023 -0400
Use Java camel-case naming conventions
---
.../org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java | 2 +-
.../java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java | 2 +-
.../org/apache/commons/imaging/formats/bmp/PixelParserSimple.java | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
index bad754c7..65a604eb 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
@@ -77,7 +77,7 @@ class PixelParserBitFields extends PixelParserSimple {
}
@Override
- public int getNextRGB() throws ImagingException, IOException {
+ public int getNextRgb() throws ImagingException, IOException {
int data;
switch (bhi.bitsPerPixel) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
index bee2f55a..18955279 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
@@ -35,7 +35,7 @@ class PixelParserRgb extends PixelParserSimple {
}
@Override
- public int getNextRGB() throws ImagingException, IOException {
+ public int getNextRgb() throws ImagingException, IOException {
switch (bhi.bitsPerPixel) {
case 1:
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
index ab184e79..81d15855 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
@@ -26,7 +26,7 @@ abstract class PixelParserSimple extends PixelParser {
super(bhi, colorTable, imageData);
}
- public abstract int getNextRGB() throws ImagingException, IOException;
+ public abstract int getNextRgb() throws ImagingException, IOException;
public abstract void newline() throws ImagingException, IOException;
@@ -34,7 +34,7 @@ abstract class PixelParserSimple extends PixelParser {
public void processImage(final ImageBuilder imageBuilder) throws ImagingException, IOException {
for (int y = bhi.height - 1; y >= 0; y--) {
for (int x = 0; x < bhi.width; x++) {
- final int rgb = getNextRGB();
+ final int rgb = getNextRgb();
imageBuilder.setRgb(x, y, rgb);
// db.setElem(y * bhi.width + x, rgb);
[commons-imaging] 08/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 be4b44bcdbeb19d3a40a5919e17e10f1488d6ff0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:52:56 2023 -0400
Use Java camel-case naming conventions
---
.../org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index ba1600b2..edb86c7d 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -141,7 +141,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
private final float[] block = new float[64];
- private Block[] allocateMCUMemory() throws ImagingException {
+ private Block[] allocateMcuMemory() throws ImagingException {
final Block[] mcu = Allocator.array(sosSegment.numberOfComponents, Block[]::new, Block.SHALLOW_SIZE);
for (int i = 0; i < sosSegment.numberOfComponents; i++) {
final SosSegment.Component scanComponent = sosSegment.getComponents(i);
@@ -443,7 +443,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
final int xMCUs = (sofnSegment.width + hSize - 1) / hSize;
final int yMCUs = (sofnSegment.height + vSize - 1) / vSize;
- final Block[] mcu = allocateMCUMemory();
+ final Block[] mcu = allocateMcuMemory();
final Block[] scaledMCU = Allocator.array(mcu.length, Block[]::new, Block.SHALLOW_SIZE);
Arrays.setAll(scaledMCU, i -> new Block(hSize, vSize));
final int[] preds = Allocator.intArray(sofnSegment.numberOfComponents);
[commons-imaging] 24/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 ed4576448bd407af230e74f80491075751598a0f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:13:54 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
index 5de54496..39408253 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
@@ -33,7 +33,7 @@ class PamFileInfo extends FileInfo {
}
@Override
- public int getRGB(final InputStream is) throws IOException {
+ public int getRgb(final InputStream is) throws IOException {
int red = readSample(is, bytesPerSample);
int green = readSample(is, bytesPerSample);
int blue = readSample(is, bytesPerSample);
@@ -67,7 +67,7 @@ class PamFileInfo extends FileInfo {
}
@Override
- public int getRGB(final InputStream is) throws IOException {
+ public int getRgb(final InputStream is) throws IOException {
int sample = readSample(is, bytesPerSample);
sample = scaleSample(sample, scale, maxval);
@@ -85,7 +85,7 @@ class PamFileInfo extends FileInfo {
}
private abstract static class TupleReader {
public abstract ImageInfo.ColorType getColorType();
- public abstract int getRGB(InputStream is) throws IOException;
+ public abstract int getRgb(InputStream is) throws IOException;
}
private final int depth;
private final int maxval;
@@ -167,7 +167,7 @@ class PamFileInfo extends FileInfo {
@Override
public int getRgb(final InputStream is) throws IOException {
- return tupleReader.getRGB(is);
+ return tupleReader.getRgb(is);
}
@Override
[commons-imaging] 27/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 0d03445a7e9efbe2c3b1ae3731c7ea1576fe6da5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:15:47 2023 -0400
Use Java camel-case naming conventions
---
.../commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java b/src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java
index 08799c6a..0c3e221f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java
@@ -391,7 +391,7 @@ public final class T4AndT6Compression {
int rowLength;
try {
final T4_T6_Tables.Entry entry = CONTROL_CODES.decode(inputStream);
- if (!isEOL(entry, hasFill)) {
+ if (!isEol(entry, hasFill)) {
throw new ImagingException("Expected EOL not found");
}
int color = WHITE;
@@ -439,7 +439,7 @@ public final class T4AndT6Compression {
int rowLength = 0;
try {
T4_T6_Tables.Entry entry = CONTROL_CODES.decode(inputStream);
- if (!isEOL(entry, hasFill)) {
+ if (!isEol(entry, hasFill)) {
throw new ImagingException("Expected EOL not found");
}
final int tagBit = inputStream.readBits(1);
@@ -621,7 +621,7 @@ public final class T4AndT6Compression {
}
}
- private static boolean isEOL(final T4_T6_Tables.Entry entry, final boolean hasFill) {
+ private static boolean isEol(final T4_T6_Tables.Entry entry, final boolean hasFill) {
if (entry == T4_T6_Tables.EOL) {
return true;
}
[commons-imaging] 06/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 12234c2a338e0d07c0e68ec3cbf4f453a88631ed
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:44:31 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/bmp/PixelParser.java | 2 +-
.../java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java | 4 ++--
.../java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java
index fef3910a..0ef318df 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java
@@ -39,7 +39,7 @@ abstract class PixelParser {
is = new ByteArrayInputStream(imageData);
}
- int getColorTableRGB(int index) {
+ int getColorTableRgb(int index) {
index *= 4;
final int blue = 0xff & colorTable[index + 0];
final int green = 0xff & colorTable[index + 1];
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
index 18955279..4f533cc3 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
@@ -54,11 +54,11 @@ class PixelParserRgb extends PixelParserSimple {
final int sample = cacheMask & (cachedByte >> (8 - bhi.bitsPerPixel));
cachedByte = 0xff & (cachedByte << bhi.bitsPerPixel);
cachedBitCount -= bhi.bitsPerPixel;
- return getColorTableRGB(sample);
+ return getColorTableRgb(sample);
}
case 8: {
final int sample = 0xff & imageData[byteCount + 0];
- final int rgb = getColorTableRGB(sample);
+ final int rgb = getColorTableRgb(sample);
byteCount += 1;
return rgb;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
index 7483bf4d..7800cf55 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
@@ -35,14 +35,14 @@ class PixelParserRle extends PixelParser {
int[] rgbs;
if (bhi.bitsPerPixel == 8) {
rgbs = new int[1];
- rgbs[0] = getColorTableRGB(data);
+ rgbs[0] = getColorTableRgb(data);
// pixels_written = 1;
} else if (bhi.bitsPerPixel == 4) {
rgbs = new int[2];
final int sample1 = data >> 4;
final int sample2 = 0x0f & data;
- rgbs[0] = getColorTableRGB(sample1);
- rgbs[1] = getColorTableRGB(sample2);
+ rgbs[0] = getColorTableRgb(sample1);
+ rgbs[1] = getColorTableRgb(sample2);
// pixels_written = 2;
} else {
throw new ImagingException("BMP RLE: bad BitsPerPixel: "
[commons-imaging] 11/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 59234d03b4c4eb10060e8214792b393328a3a478
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:56:03 2023 -0400
Use Java camel-case naming conventions
---
.../apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
index fcaab153..60bd2d20 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
@@ -132,7 +132,7 @@ public class ExifRewriter extends BinaryFileParser {
super(byteOrder);
}
- private JFIFPieces analyzeJFIF(final ByteSource byteSource) throws ImagingException, IOException {
+ private JFIFPieces analyzeJfif(final ByteSource byteSource) throws ImagingException, IOException {
final List<JFIFPiece> pieces = new ArrayList<>();
final List<JFIFPiece> exifPieces = new ArrayList<>();
@@ -220,7 +220,7 @@ public class ExifRewriter extends BinaryFileParser {
*/
public void removeExifMetadata(final ByteSource byteSource, final OutputStream os)
throws ImagingException, IOException, ImagingException {
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
final List<JFIFPiece> pieces = jfifPieces.pieces;
// Debug.debug("pieces", pieces);
@@ -327,7 +327,7 @@ public class ExifRewriter extends BinaryFileParser {
final OutputStream os, final TiffOutputSet outputSet)
throws ImagingException, IOException, ImagingException {
// List outputDirectories = outputSet.getDirectories();
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
final List<JFIFPiece> pieces = jfifPieces.pieces;
TiffImageWriterBase writer;
@@ -453,7 +453,7 @@ public class ExifRewriter extends BinaryFileParser {
public void updateExifMetadataLossy(final ByteSource byteSource, final OutputStream os,
final TiffOutputSet outputSet) throws ImagingException, IOException,
ImagingException {
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
final List<JFIFPiece> pieces = jfifPieces.pieces;
final TiffImageWriterBase writer = new TiffImageWriterLossy(
[commons-imaging] 03/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 83f197611edb4c1d2c04d53dbe47fb085d3f6447
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:41:43 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/ImageParser.java | 18 +++++++++---------
src/main/java/org/apache/commons/imaging/Imaging.java | 2 +-
.../commons/imaging/formats/bmp/BmpImageParser.java | 2 +-
.../commons/imaging/formats/dcx/DcxImageParser.java | 2 +-
.../commons/imaging/formats/gif/GifImageParser.java | 2 +-
.../commons/imaging/formats/icns/IcnsImageParser.java | 2 +-
.../commons/imaging/formats/ico/IcoImageParser.java | 2 +-
.../commons/imaging/formats/jpeg/JpegImageParser.java | 2 +-
.../commons/imaging/formats/pcx/PcxImageParser.java | 2 +-
.../commons/imaging/formats/png/PngImageParser.java | 2 +-
.../commons/imaging/formats/pnm/PnmImageParser.java | 2 +-
.../commons/imaging/formats/psd/PsdImageParser.java | 2 +-
.../commons/imaging/formats/rgbe/RgbeImageParser.java | 2 +-
.../commons/imaging/formats/tiff/TiffImageParser.java | 2 +-
.../commons/imaging/formats/wbmp/WbmpImageParser.java | 2 +-
.../commons/imaging/formats/xbm/XbmImageParser.java | 2 +-
.../commons/imaging/formats/xpm/XpmImageParser.java | 2 +-
17 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/ImageParser.java b/src/main/java/org/apache/commons/imaging/ImageParser.java
index 9a188714..915b1c7d 100644
--- a/src/main/java/org/apache/commons/imaging/ImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/ImageParser.java
@@ -490,8 +490,8 @@ public abstract class ImageParser<T extends ImagingParameters<T>> extends Binary
* parser implementation.
* @throws IOException In the event of unsuccessful read or access operation.
*/
- public final byte[] getICCProfileBytes(final byte[] bytes) throws ImagingException, IOException {
- return getICCProfileBytes(bytes, null);
+ public final byte[] getIccProfileBytes(final byte[] bytes) throws ImagingException, IOException {
+ return getIccProfileBytes(bytes, null);
}
/**
@@ -508,9 +508,9 @@ public abstract class ImageParser<T extends ImagingParameters<T>> extends Binary
* parser implementation.
* @throws IOException In the event of unsuccessful read or access operation.
*/
- public final byte[] getICCProfileBytes(final byte[] bytes, final T params)
+ public final byte[] getIccProfileBytes(final byte[] bytes, final T params)
throws ImagingException, IOException {
- return getICCProfileBytes(ByteSource.array(bytes), params);
+ return getIccProfileBytes(ByteSource.array(bytes), params);
}
/**
@@ -527,7 +527,7 @@ public abstract class ImageParser<T extends ImagingParameters<T>> extends Binary
* parser implementation.
* @throws IOException In the event of unsuccessful read or access operation.
*/
- public abstract byte[] getICCProfileBytes(ByteSource byteSource, T params)
+ public abstract byte[] getIccProfileBytes(ByteSource byteSource, T params)
throws ImagingException, IOException;
/**
@@ -542,8 +542,8 @@ public abstract class ImageParser<T extends ImagingParameters<T>> extends Binary
* parser implementation.
* @throws IOException In the event of unsuccessful read or access operation.
*/
- public final byte[] getICCProfileBytes(final File file) throws ImagingException, IOException {
- return getICCProfileBytes(file, null);
+ public final byte[] getIccProfileBytes(final File file) throws ImagingException, IOException {
+ return getIccProfileBytes(file, null);
}
/**
@@ -560,7 +560,7 @@ public abstract class ImageParser<T extends ImagingParameters<T>> extends Binary
* parser implementation.
* @throws IOException In the event of unsuccessful read or access operation.
*/
- public final byte[] getICCProfileBytes(final File file, final T params)
+ public final byte[] getIccProfileBytes(final File file, final T params)
throws ImagingException, IOException {
if (!canAcceptExtension(file)) {
return null;
@@ -570,7 +570,7 @@ public abstract class ImageParser<T extends ImagingParameters<T>> extends Binary
LOGGER.finest(getName() + ": " + file.getName());
}
- return getICCProfileBytes(ByteSource.file(file), params);
+ return getIccProfileBytes(ByteSource.file(file), params);
}
/**
diff --git a/src/main/java/org/apache/commons/imaging/Imaging.java b/src/main/java/org/apache/commons/imaging/Imaging.java
index 79cb0c43..ee45d75e 100644
--- a/src/main/java/org/apache/commons/imaging/Imaging.java
+++ b/src/main/java/org/apache/commons/imaging/Imaging.java
@@ -369,7 +369,7 @@ public final class Imaging {
private static byte[] getICCProfileBytes(final ByteSource byteSource) throws ImagingException, IOException {
final ImageParser<?> imageParser = ImageParserFactory.getImageParser(byteSource);
- return imageParser.getICCProfileBytes(byteSource, null);
+ return imageParser.getIccProfileBytes(byteSource, null);
}
/**
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 017702cb..d3495b9d 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
@@ -169,7 +169,7 @@ public class BmpImageParser extends ImageParser<BmpImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final BmpImagingParameters params) {
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final BmpImagingParameters params) {
return null;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java b/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
index 07472847..c07961dd 100644
--- a/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
@@ -122,7 +122,7 @@ public class DcxImageParser extends ImageParser<PcxImagingParameters> {
// FIXME should throw UOE
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final PcxImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final PcxImagingParameters params)
throws ImagingException, IOException {
return null;
}
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 622eb659..da484a65 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
@@ -399,7 +399,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final GifImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final GifImagingParameters params)
throws ImagingException, IOException {
return null;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
index 1397ec0e..8851f437 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
@@ -148,7 +148,7 @@ public class IcnsImageParser extends ImageParser<IcnsImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final IcnsImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final IcnsImagingParameters params)
throws ImagingException, IOException {
return null;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java b/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
index 8f180d5e..f3bbc168 100644
--- a/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
@@ -297,7 +297,7 @@ public class IcoImageParser extends ImageParser<IcoImagingParameters> {
// TODO should throw UOE
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final IcoImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final IcoImagingParameters params)
throws ImagingException, IOException {
return 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 0cac60ce..1bae1255 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
@@ -283,7 +283,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final JpegImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final JpegImagingParameters params)
throws ImagingException, IOException {
final List<Segment> segments = readSegments(byteSource,
new int[] { JpegConstants.JPEG_APP2_MARKER, }, false);
diff --git a/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java b/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
index 817c5021..71a8ff73 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
@@ -200,7 +200,7 @@ public class PcxImageParser extends ImageParser<PcxImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final PcxImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final PcxImagingParameters params)
throws ImagingException, IOException {
return null;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
index 66919c44..3390d83f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
@@ -348,7 +348,7 @@ public class PngImageParser extends ImageParser<PngImagingParameters> implement
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final PngImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final PngImagingParameters params)
throws ImagingException, IOException {
final List<PngChunk> chunks = readChunks(byteSource, new ChunkType[] { ChunkType.iCCP },
true);
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 afec292f..955156d0 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
@@ -116,7 +116,7 @@ public class PnmImageParser extends ImageParser<PnmImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final PnmImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final PnmImagingParameters params)
throws ImagingException, IOException {
return null;
}
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 22c44786..ea2a040a 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
@@ -320,7 +320,7 @@ public class PsdImageParser extends ImageParser<PsdImagingParameters> implements
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final PsdImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final PsdImagingParameters params)
throws ImagingException, IOException {
final List<ImageResourceBlock> blocks = readImageResourceBlocks(byteSource,
new int[] { IMAGE_RESOURCE_ID_ICC_PROFILE, }, 1);
diff --git a/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java b/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java
index ee0d5e29..0f0a5fd1 100644
--- a/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeImageParser.java
@@ -84,7 +84,7 @@ public class RgbeImageParser extends ImageParser<RgbeImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final RgbeImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final RgbeImagingParameters params)
throws ImagingException, IOException {
return 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 a89ffb05..17ed6eca 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
@@ -418,7 +418,7 @@ public class TiffImageParser extends ImageParser<TiffImagingParameters> implemen
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final TiffImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final TiffImagingParameters params)
throws ImagingException, IOException {
final FormatCompliance formatCompliance = FormatCompliance.getDefault();
final TiffContents contents = new TiffReader(params != null && params.isStrict()).readFirstDirectory(
diff --git a/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java b/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java
index 77c71208..d7e1b665 100644
--- a/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java
@@ -106,7 +106,7 @@ public class WbmpImageParser extends ImageParser<WbmpImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final WbmpImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final WbmpImagingParameters params)
throws ImagingException, IOException {
return null;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java b/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java
index 262be0e2..7f50dbdf 100644
--- a/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java
@@ -152,7 +152,7 @@ public class XbmImageParser extends ImageParser<XbmImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final XbmImagingParameters params)
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final XbmImagingParameters params)
throws ImagingException, IOException {
return null;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java b/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
index 0d7d8df3..2437a4a8 100644
--- a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
@@ -203,7 +203,7 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
}
@Override
- public byte[] getICCProfileBytes(final ByteSource byteSource, final XpmImagingParameters params) throws ImagingException, IOException {
+ public byte[] getIccProfileBytes(final ByteSource byteSource, final XpmImagingParameters params) throws ImagingException, IOException {
return null;
}
[commons-imaging] 17/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 3ce9e32c1785b45fe386ce31b4c587a1b48429ca
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:02:51 2023 -0400
Use Java camel-case naming conventions
---
.../apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java | 4 ++--
.../org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java | 2 +-
.../org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.java | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
index e2e4da7c..220ab1e6 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
@@ -122,7 +122,7 @@ public class JpegIptcRewriter extends JpegRewriter {
*/
public void removeIptc(final ByteSource byteSource, final OutputStream os, final boolean removeSegment)
throws ImagingException, IOException, ImagingException {
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
final List<JFIFPiece> oldPieces = jfifPieces.pieces;
final List<JFIFPiece> photoshopApp13Segments = findPhotoshopApp13Segments(oldPieces);
@@ -287,7 +287,7 @@ public class JpegIptcRewriter extends JpegRewriter {
public void writeIptc(final ByteSource byteSource, final OutputStream os,
PhotoshopApp13Data newData) throws ImagingException, IOException,
ImagingException {
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
final List<JFIFPiece> oldPieces = jfifPieces.pieces;
final List<JFIFPiece> photoshopApp13Segments = findPhotoshopApp13Segments(oldPieces);
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 c3a1a792..d71a222d 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
@@ -169,7 +169,7 @@ public class JpegRewriter extends BinaryFileParser {
super(JPEG_BYTE_ORDER);
}
- protected JFIFPieces analyzeJFIF(final ByteSource byteSource) throws ImagingException, IOException {
+ protected JFIFPieces analyzeJfif(final ByteSource byteSource) throws ImagingException, IOException {
final List<JFIFPiece> pieces = new ArrayList<>();
final List<JFIFPiece> segmentPieces = new ArrayList<>();
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.java
index 20797e94..befc3929 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.java
@@ -66,7 +66,7 @@ public class JpegXmpRewriter extends JpegRewriter {
*/
public void removeXmpXml(final ByteSource byteSource, final OutputStream os)
throws ImagingException, IOException {
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
List<JFIFPiece> pieces = jfifPieces.pieces;
pieces = removeXmpSegments(pieces);
writeSegments(os, pieces);
@@ -148,7 +148,7 @@ public class JpegXmpRewriter extends JpegRewriter {
public void updateXmpXml(final ByteSource byteSource, final OutputStream os,
final String xmpXml) throws ImagingException, IOException,
ImagingException {
- final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
+ final JFIFPieces jfifPieces = analyzeJfif(byteSource);
List<JFIFPiece> pieces = jfifPieces.pieces;
pieces = removeXmpSegments(pieces);
[commons-imaging] 19/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 89e86234f7f5aeabacc419573a44c73ebd609988
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:05:53 2023 -0400
Use Java camel-case naming conventions
---
.../org/apache/commons/imaging/formats/jpeg/JpegImageParser.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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 9e90beb1..49733d91 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
@@ -69,7 +69,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
private static final String DEFAULT_EXTENSION = ImageFormats.JPEG.getDefaultExtension();
private static final String[] ACCEPTED_EXTENSIONS = ImageFormats.JPEG.getExtensions();
- public static boolean isExifAPP1Segment(final GenericSegment segment) {
+ public static boolean isExifApp1Segment(final GenericSegment segment) {
return startsWith(segment.getSegmentData(), JpegConstants.EXIF_IDENTIFIER_CODE);
}
@@ -189,12 +189,12 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
Debug.debug();
}
- private List<Segment> filterAPP1Segments(final List<Segment> segments) {
+ private List<Segment> filterApp1Segments(final List<Segment> segments) {
final List<Segment> result = new ArrayList<>();
for (final Segment s : segments) {
final GenericSegment segment = (GenericSegment) s;
- if (isExifAPP1Segment(segment)) {
+ if (isExifApp1Segment(segment)) {
result.add(segment);
}
}
@@ -254,7 +254,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
return null;
}
- final List<Segment> exifSegments = filterAPP1Segments(segments);
+ final List<Segment> exifSegments = filterApp1Segments(segments);
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.finest("exifSegments.size()" + ": " + exifSegments.size());
}
[commons-imaging] 22/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 c6399d9049332784dd2e3ab9c04f2990efc88249
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:12:13 2023 -0400
Use Java camel-case naming conventions
---
.../commons/imaging/formats/png/ScanExpediter.java | 26 +++++++++++-----------
.../formats/png/ScanExpediterInterlaced.java | 2 +-
.../imaging/formats/png/ScanExpediterSimple.java | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java b/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java
index afb14c0c..6d258c50 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java
@@ -43,7 +43,7 @@ abstract class ScanExpediter {
final int bitDepth;
final int bytesPerPixel;
final int bitsPerPixel;
- final PngChunkPlte pngChunkPLTE;
+ final PngChunkPlte pngChunkPlte;
final GammaCorrection gammaCorrection;
final TransparencyFilter transparencyFilter;
@@ -59,7 +59,7 @@ abstract class ScanExpediter {
this.bitDepth = bitDepth;
this.bytesPerPixel = this.getBitsToBytesRoundingUp(bitsPerPixel);
this.bitsPerPixel = bitsPerPixel;
- this.pngChunkPLTE = pngChunkPLTE;
+ this.pngChunkPlte = pngChunkPLTE;
this.gammaCorrection = gammaCorrection;
this.transparencyFilter = transparencyFilter;
}
@@ -85,18 +85,18 @@ abstract class ScanExpediter {
return unfilterScanline(FilterType.values()[filterType], scanline, prev, bytesPerPixel);
}
- final int getPixelARGB(final int alpha, final int red, final int green, final int blue) {
+ final int getPixelArgb(final int alpha, final int red, final int green, final int blue) {
return ((0xff & alpha) << 24)
| ((0xff & red) << 16)
| ((0xff & green) << 8)
| ((0xff & blue) << 0);
}
- final int getPixelRGB(final int red, final int green, final int blue) {
- return getPixelARGB(0xff, red, green, blue);
+ final int getPixelRgb(final int red, final int green, final int blue) {
+ return getPixelArgb(0xff, red, green, blue);
}
- int getRGB(final BitParser bitParser, final int pixelIndexInScanline)
+ int getRgb(final BitParser bitParser, final int pixelIndexInScanline)
throws ImagingException, IOException {
switch (pngColorType) {
@@ -108,7 +108,7 @@ abstract class ScanExpediter {
sample = gammaCorrection.correctSample(sample);
}
- int rgb = getPixelRGB(sample, sample, sample);
+ int rgb = getPixelRgb(sample, sample, sample);
if (transparencyFilter != null) {
rgb = transparencyFilter.filter(rgb, sample);
@@ -123,7 +123,7 @@ abstract class ScanExpediter {
int green = bitParser.getSampleAsByte(pixelIndexInScanline, 1);
int blue = bitParser.getSampleAsByte(pixelIndexInScanline, 2);
- int rgb = getPixelRGB(red, green, blue);
+ int rgb = getPixelRgb(red, green, blue);
if (transparencyFilter != null) {
rgb = transparencyFilter.filter(rgb, -1);
@@ -135,7 +135,7 @@ abstract class ScanExpediter {
red = gammaCorrection.correctSample(red);
green = gammaCorrection.correctSample(green);
blue = gammaCorrection.correctSample(blue);
- rgb = getPixelARGB(alpha, red, green, blue);
+ rgb = getPixelArgb(alpha, red, green, blue);
}
return rgb;
@@ -144,12 +144,12 @@ abstract class ScanExpediter {
case INDEXED_COLOR: {
// 1,2,4,8 Each pixel is a palette index;
// a PLTE chunk must appear.
- if (pngChunkPLTE == null) {
+ if (pngChunkPlte == null) {
throw new ImagingException("A PLTE chunk is required for an indexed color type.");
}
final int index = bitParser.getSample(pixelIndexInScanline, 0);
- int rgb = pngChunkPLTE.getRGB(index);
+ int rgb = pngChunkPlte.getRGB(index);
if (transparencyFilter != null) {
rgb = transparencyFilter.filter(rgb, index);
@@ -167,7 +167,7 @@ abstract class ScanExpediter {
sample = gammaCorrection.correctSample(sample);
}
- return getPixelARGB(alpha, sample, sample, sample);
+ return getPixelArgb(alpha, sample, sample, sample);
}
case TRUE_COLOR_WITH_ALPHA: {
// 8,16 Each pixel is an R,G,B triple,
@@ -182,7 +182,7 @@ abstract class ScanExpediter {
blue = gammaCorrection.correctSample(blue);
}
- return getPixelARGB(alpha, red, green, blue);
+ return getPixelArgb(alpha, red, green, blue);
}
default:
throw new ImagingException("PNG: unknown color type: " + pngColorType);
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 b65fdbe0..0e60d833 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
@@ -84,7 +84,7 @@ class ScanExpediterInterlaced extends ScanExpediter {
private void visit(final int x, final int y, final BufferedImage bi, final BitParser fBitParser,
final int pixelIndexInScanline)
throws ImagingException, IOException {
- final int rgb = getRGB(fBitParser, pixelIndexInScanline);
+ final int rgb = getRgb(fBitParser, pixelIndexInScanline);
bi.setRGB(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java b/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java
index a685a861..a605544e 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java
@@ -48,7 +48,7 @@ class ScanExpediterSimple extends ScanExpediter {
bitDepth);
for (int x = 0; x < width; x++) {
- final int rgb = getRGB(bitParser, x);
+ final int rgb = getRgb(bitParser, x);
bi.setRGB(x, y, rgb);
}
[commons-imaging] 29/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 39bb6b3b8e5a21ffdd9a8103eda8423142664ddb
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:17:33 2023 -0400
Use Java camel-case naming conventions
---
.../commons/imaging/formats/tiff/write/TiffOutputSet.java | 12 ++++++------
.../commons/imaging/examples/WriteExifMetadataExample.java | 4 ++--
.../imaging/formats/tiff/write/TiffOutputSetTest.java | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java
index ed80fc98..2dd29bcb 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java
@@ -60,7 +60,7 @@ public final class TiffOutputSet implements Iterable<TiffOutputDirectory> {
return result;
}
- public TiffOutputDirectory addGPSDirectory() throws ImagingException {
+ public TiffOutputDirectory addGpsDirectory() throws ImagingException {
final TiffOutputDirectory result = new TiffOutputDirectory(
TiffDirectoryConstants.DIRECTORY_TYPE_GPS, byteOrder);
addDirectory(result);
@@ -119,7 +119,7 @@ public final class TiffOutputSet implements Iterable<TiffOutputDirectory> {
return findDirectory(TiffDirectoryConstants.DIRECTORY_TYPE_EXIF);
}
- public TiffOutputDirectory getGPSDirectory() {
+ public TiffOutputDirectory getGpsDirectory() {
return findDirectory(TiffDirectoryConstants.DIRECTORY_TYPE_GPS);
}
@@ -139,7 +139,7 @@ public final class TiffOutputSet implements Iterable<TiffOutputDirectory> {
return addExifDirectory();
}
- public TiffOutputDirectory getOrCreateGPSDirectory()
+ public TiffOutputDirectory getOrCreateGpsDirectory()
throws ImagingException {
// GPS directory requires EXIF directory
getOrCreateExifDirectory();
@@ -148,7 +148,7 @@ public final class TiffOutputSet implements Iterable<TiffOutputDirectory> {
if (null != result) {
return result;
}
- return addGPSDirectory();
+ return addGpsDirectory();
}
public TiffOutputDirectory getOrCreateRootDirectory()
@@ -203,9 +203,9 @@ public final class TiffOutputSet implements Iterable<TiffOutputDirectory> {
* latitude in degrees N, negative values are S.
* @throws ImagingException if it fails to write the new data to the GPS directory
*/
- public void setGPSInDegrees(double longitude, double latitude)
+ public void setGpsInDegrees(double longitude, double latitude)
throws ImagingException {
- final TiffOutputDirectory gpsDirectory = getOrCreateGPSDirectory();
+ final TiffOutputDirectory gpsDirectory = getOrCreateGpsDirectory();
gpsDirectory.removeField(GpsTagConstants.GPS_TAG_GPS_VERSION_ID);
gpsDirectory.add(GpsTagConstants.GPS_TAG_GPS_VERSION_ID, GpsTagConstants.gpsVersion());
diff --git a/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java b/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java
index 29473ff2..d6bd5375 100644
--- a/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java
+++ b/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java
@@ -111,7 +111,7 @@ public class WriteExifMetadataExample {
final double latitude = 40 + 43 / 60.0; // 40 degrees N (in Degrees
// North)
- outputSet.setGPSInDegrees(longitude, latitude);
+ outputSet.setGpsInDegrees(longitude, latitude);
}
// printTagValue(jpegMetadata, TiffConstants.TIFF_TAG_DATE_TIME);
@@ -258,7 +258,7 @@ public class WriteExifMetadataExample {
final double latitude = 40 + 43 / 60.0; // 40 degrees N (in Degrees
// North)
- outputSet.setGPSInDegrees(longitude, latitude);
+ outputSet.setGpsInDegrees(longitude, latitude);
}
new ExifRewriter().updateExifMetadataLossless(jpegImageFile, os,
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
index 9074a11a..c6f2234a 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
@@ -39,7 +39,7 @@ public class TiffOutputSetTest {
*/
@Test
public void testImaging144() throws Exception {
- tiffOutputSet.setGPSInDegrees(1.0, 1.0);
+ tiffOutputSet.setGpsInDegrees(1.0, 1.0);
final TiffOutputField gpsVersionId = tiffOutputSet.findField(GpsTagConstants.GPS_TAG_GPS_VERSION_ID);
[commons-imaging] 15/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 5cf3282301978438d2b0a296e2890ea6ace2456c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:00:05 2023 -0400
Use Java camel-case naming conventions
---
.../commons/imaging/formats/gif/GifImageParser.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
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 da484a65..7e48e656 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
@@ -615,7 +615,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
case COMMENT_EXTENSION:
case PLAIN_TEXT_EXTENSION: {
- final GenericGifBlock block = readGenericGIFBlock(is,
+ final GenericGifBlock block = readGenericGifBlock(is,
completeCode);
result.add(block);
break;
@@ -634,7 +634,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
}
if (label.length > 0) {
- final GenericGifBlock block = readGenericGIFBlock(is,
+ final GenericGifBlock block = readGenericGifBlock(is,
completeCode, label);
result.add(block);
}
@@ -648,7 +648,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
completeCode);
}
- final GenericGifBlock block = readGenericGIFBlock(is,
+ final GenericGifBlock block = readGenericGifBlock(is,
completeCode);
result.add(block);
break;
@@ -701,12 +701,12 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
}
}
- private GenericGifBlock readGenericGIFBlock(final InputStream is, final int code)
+ private GenericGifBlock readGenericGifBlock(final InputStream is, final int code)
throws IOException {
- return readGenericGIFBlock(is, code, null);
+ return readGenericGifBlock(is, code, null);
}
- private GenericGifBlock readGenericGIFBlock(final InputStream is, final int code,
+ private GenericGifBlock readGenericGifBlock(final InputStream is, final int code,
final byte[] first) throws IOException {
final List<byte[]> subBlocks = new ArrayList<>();
@@ -871,7 +871,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
if (!stopBeforeImageData) {
final int lzwMinimumCodeSize = is.read();
- final GenericGifBlock block = readGenericGIFBlock(is, -1);
+ final GenericGifBlock block = readGenericGifBlock(is, -1);
final byte[] bytes = block.appendSubBlocks();
final InputStream bais = new ByteArrayInputStream(bytes);
@@ -885,7 +885,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
LOGGER.finest("LZWMinimumCodeSize: " + LZWMinimumCodeSize);
}
- readGenericGIFBlock(is, -1);
+ readGenericGifBlock(is, -1);
}
return new ImageDescriptor(blockCode,
[commons-imaging] 31/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 5baa945b11fa1aa987bee394c28a3ece66e4e271
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:18:11 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java | 2 +-
src/test/java/org/apache/commons/imaging/examples/MetadataExample.java | 2 +-
src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
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 d28d7d70..aa04543a 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
@@ -491,7 +491,7 @@ public class TiffImageMetadata extends GenericImageMetadata {
return tag.getValue(field);
}
- public GpsInfo getGPS() throws ImagingException {
+ public GpsInfo getGpsInfo() throws ImagingException {
final TiffDirectory gpsDirectory = findDirectory(TiffDirectoryConstants.DIRECTORY_TYPE_GPS);
if (null == gpsDirectory) {
return null;
diff --git a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
index 26469e6e..d047bbf5 100644
--- a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
+++ b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
@@ -78,7 +78,7 @@ public class MetadataExample {
// simple interface to GPS data
final TiffImageMetadata exifMetadata = jpegMetadata.getExif();
if (null != exifMetadata) {
- final TiffImageMetadata.GpsInfo gpsInfo = exifMetadata.getGPS();
+ final TiffImageMetadata.GpsInfo gpsInfo = exifMetadata.getGpsInfo();
if (null != gpsInfo) {
final String gpsDescription = gpsInfo.toString();
final double longitude = gpsInfo.getLongitudeAsDegreesEast();
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
index 1432178e..dfba9288 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
@@ -50,7 +50,7 @@ public class GpsTest extends ExifBaseTest {
return;
}
- final TiffImageMetadata.GpsInfo gpsInfo = exifMetadata.getGPS();
+ final TiffImageMetadata.GpsInfo gpsInfo = exifMetadata.getGpsInfo();
if (null == gpsInfo) {
return;
}
[commons-imaging] 16/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 211eaac55209baa8eb527654aeb17bfe41ffa1c0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:02:06 2023 -0400
Use Java camel-case naming conventions
---
.../formats/jpeg/iptc/JpegIptcRewriter.java | 44 +++++++++++-----------
.../formats/jpeg/exif/MicrosoftTagTest.java | 2 +-
.../imaging/formats/jpeg/iptc/IptcAddTest.java | 2 +-
.../formats/jpeg/iptc/IptcFullDiscardTest.java | 4 +-
.../imaging/formats/jpeg/iptc/IptcUpdateTest.java | 6 +--
5 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
index 7cc09f51..e2e4da7c 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.java
@@ -52,9 +52,9 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final byte[] src, final OutputStream os)
+ public void removeIptc(final byte[] src, final OutputStream os)
throws ImagingException, IOException, ImagingException {
- removeIPTC(src, os, false);
+ removeIptc(src, os, false);
}
/**
@@ -75,10 +75,10 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final byte[] src, final OutputStream os, final boolean removeSegment)
+ public void removeIptc(final byte[] src, final OutputStream os, final boolean removeSegment)
throws ImagingException, IOException, ImagingException {
final ByteSource byteSource = ByteSource.array(src);
- removeIPTC(byteSource, os, removeSegment);
+ removeIptc(byteSource, os, removeSegment);
}
/**
@@ -97,9 +97,9 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final ByteSource byteSource, final OutputStream os)
+ public void removeIptc(final ByteSource byteSource, final OutputStream os)
throws ImagingException, IOException, ImagingException {
- removeIPTC(byteSource, os, false);
+ removeIptc(byteSource, os, false);
}
/**
@@ -120,7 +120,7 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final ByteSource byteSource, final OutputStream os, final boolean removeSegment)
+ public void removeIptc(final ByteSource byteSource, final OutputStream os, final boolean removeSegment)
throws ImagingException, IOException, ImagingException {
final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
final List<JFIFPiece> oldPieces = jfifPieces.pieces;
@@ -166,9 +166,9 @@ public class JpegIptcRewriter extends JpegRewriter {
* @see java.io.File
* @see java.io.OutputStream
*/
- public void removeIPTC(final File src, final OutputStream os)
+ public void removeIptc(final File src, final OutputStream os)
throws ImagingException, IOException, ImagingException {
- removeIPTC(src, os, false);
+ removeIptc(src, os, false);
}
/**
@@ -192,10 +192,10 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final File src, final OutputStream os, final boolean removeSegment)
+ public void removeIptc(final File src, final OutputStream os, final boolean removeSegment)
throws ImagingException, IOException, ImagingException {
final ByteSource byteSource = ByteSource.file(src);
- removeIPTC(byteSource, os, removeSegment);
+ removeIptc(byteSource, os, removeSegment);
}
/**
@@ -214,9 +214,9 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final InputStream src, final OutputStream os)
+ public void removeIptc(final InputStream src, final OutputStream os)
throws ImagingException, IOException, ImagingException {
- removeIPTC(src, os, false);
+ removeIptc(src, os, false);
}
/**
@@ -237,10 +237,10 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void removeIPTC(final InputStream src, final OutputStream os, final boolean removeSegment)
+ public void removeIptc(final InputStream src, final OutputStream os, final boolean removeSegment)
throws ImagingException, IOException, ImagingException {
final ByteSource byteSource = ByteSource.inputStream(src, null);
- removeIPTC(byteSource, os, removeSegment);
+ removeIptc(byteSource, os, removeSegment);
}
/**
@@ -260,11 +260,11 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void writeIPTC(final byte[] src, final OutputStream os,
+ public void writeIptc(final byte[] src, final OutputStream os,
final PhotoshopApp13Data newData) throws ImagingException, IOException,
ImagingException {
final ByteSource byteSource = ByteSource.array(src);
- writeIPTC(byteSource, os, newData);
+ writeIptc(byteSource, os, newData);
}
/**
@@ -284,7 +284,7 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void writeIPTC(final ByteSource byteSource, final OutputStream os,
+ public void writeIptc(final ByteSource byteSource, final OutputStream os,
PhotoshopApp13Data newData) throws ImagingException, IOException,
ImagingException {
final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
@@ -335,10 +335,10 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void writeIPTC(final File src, final OutputStream os, final PhotoshopApp13Data newData)
+ public void writeIptc(final File src, final OutputStream os, final PhotoshopApp13Data newData)
throws ImagingException, IOException, ImagingException {
final ByteSource byteSource = ByteSource.file(src);
- writeIPTC(byteSource, os, newData);
+ writeIptc(byteSource, os, newData);
}
/**
@@ -358,11 +358,11 @@ public class JpegIptcRewriter extends JpegRewriter {
* target byte source
* @throws ImagingException if it fails to write the target image
*/
- public void writeIPTC(final InputStream src, final OutputStream os,
+ public void writeIptc(final InputStream src, final OutputStream os,
final PhotoshopApp13Data newData) throws ImagingException, IOException,
ImagingException {
final ByteSource byteSource = ByteSource.inputStream(src, null);
- writeIPTC(byteSource, os, newData);
+ writeIptc(byteSource, os, newData);
}
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java
index c7a2ecd4..fa5838ea 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java
@@ -73,7 +73,7 @@ public class MicrosoftTagTest extends ExifBaseTest {
final ByteArrayOutputStream noXmp = new ByteArrayOutputStream();
new JpegXmpRewriter().removeXmpXml(imageWithExif, noXmp);
final ByteArrayOutputStream noXmpNoIptc = new ByteArrayOutputStream();
- new JpegIptcRewriter().removeIPTC(noXmp.toByteArray(), noXmpNoIptc);
+ new JpegIptcRewriter().removeIptc(noXmp.toByteArray(), noXmpNoIptc);
return noXmpNoIptc.toByteArray();
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
index cb4d94b6..7699a0b3 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
@@ -74,7 +74,7 @@ public class IptcAddTest extends IptcBaseTest {
byte[] bytes;
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
- new JpegIptcRewriter().writeIPTC(byteSource, os, newData);
+ new JpegIptcRewriter().writeIptc(byteSource, os, newData);
bytes = os.toByteArray();
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java
index 3c7d0c7c..1e292588 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java
@@ -33,7 +33,7 @@ public class IptcFullDiscardTest {
final IptcRecord record = new IptcRecord(IptcTypes.KEYWORDS, "meta; data");
final PhotoshopApp13Data data = new PhotoshopApp13Data(Collections.singletonList(record), Collections.emptyList());
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- new JpegIptcRewriter().writeIPTC(bytes, byteArrayOutputStream, data);
+ new JpegIptcRewriter().writeIptc(bytes, byteArrayOutputStream, data);
return byteArrayOutputStream.toByteArray();
}
@@ -64,7 +64,7 @@ public class IptcFullDiscardTest {
private byte[] removeMetaData(final byte[] bytes, final boolean removeApp13Segment) throws Exception {
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- new JpegIptcRewriter().removeIPTC(bytes, byteArrayOutputStream, removeApp13Segment);
+ new JpegIptcRewriter().removeIptc(bytes, byteArrayOutputStream, removeApp13Segment);
return byteArrayOutputStream.toByteArray();
}
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
index 581109b7..97ad0798 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
@@ -44,7 +44,7 @@ public class IptcUpdateTest extends IptcBaseTest {
public byte[] removeIptc(final ByteSource byteSource, final File imageFile) throws Exception {
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
- new JpegIptcRewriter().removeIPTC(byteSource, os);
+ new JpegIptcRewriter().removeIptc(byteSource, os);
return os.toByteArray();
}
}
@@ -74,7 +74,7 @@ public class IptcUpdateTest extends IptcBaseTest {
byte[] updated;
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
- new JpegIptcRewriter().writeIPTC(ByteSource.array(noIptcFile,
+ new JpegIptcRewriter().writeIptc(ByteSource.array(noIptcFile,
"test.jpg"), os, newData);
updated = os.toByteArray();
}
@@ -177,7 +177,7 @@ public class IptcUpdateTest extends IptcBaseTest {
public byte[] writeIptc(final ByteSource byteSource, final PhotoshopApp13Data newData, final File imageFile) throws IOException, ImagingException, ImagingException {
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
- new JpegIptcRewriter().writeIPTC(byteSource, os, newData);
+ new JpegIptcRewriter().writeIptc(byteSource, os, newData);
return os.toByteArray();
}
}
[commons-imaging] 21/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 9a4f24b3be5b394ad6a2a3b5336dc743eca8c5ca
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:09:39 2023 -0400
Use Java camel-case naming conventions
---
.../commons/imaging/formats/png/PngImageParser.java | 2 +-
.../apache/commons/imaging/icc/IccProfileParser.java | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
index 3390d83f..96147ce7 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
@@ -304,7 +304,7 @@ public class PngImageParser extends ImageParser<PngImagingParameters> implement
scanExpediter.drive();
if (iccProfile != null) {
- final boolean isSrgb = new IccProfileParser().issRGB(iccProfile);
+ final boolean isSrgb = new IccProfileParser().isSrgb(iccProfile);
if (!isSrgb) {
final ICC_ColorSpace cs = new ICC_ColorSpace(iccProfile);
diff --git a/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java b/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
index 3479b6ce..de5419b8 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
@@ -53,7 +53,7 @@ public class IccProfileParser extends BinaryFileParser {
// TODO Throw instead of logging?
final IccProfileInfo result;
try (InputStream is = byteSource.getInputStream()) {
- result = readICCProfileInfo(is);
+ result = readIccProfileInfo(is);
}
//
for (final IccTag tag : result.getTags()) {
@@ -92,11 +92,11 @@ public class IccProfileParser extends BinaryFileParser {
return null;
}
- public boolean issRGB(final byte[] bytes) throws IOException {
- return issRGB(ByteSource.array(bytes));
+ public boolean isSrgb(final byte[] bytes) throws IOException {
+ return isSrgb(ByteSource.array(bytes));
}
- public boolean issRGB(final ByteSource byteSource) throws IOException {
+ public boolean isSrgb(final ByteSource byteSource) throws IOException {
// setDebug(true);
// long length = byteSource.getLength();
@@ -130,15 +130,15 @@ public class IccProfileParser extends BinaryFileParser {
}
}
- public boolean issRGB(final File file) throws IOException {
- return issRGB(ByteSource.file(file));
+ public boolean isSrgb(final File file) throws IOException {
+ return isSrgb(ByteSource.file(file));
}
- public boolean issRGB(final ICC_Profile iccProfile) throws IOException {
- return issRGB(ByteSource.array(iccProfile.getData()));
+ public boolean isSrgb(final ICC_Profile iccProfile) throws IOException {
+ return isSrgb(ByteSource.array(iccProfile.getData()));
}
- private IccProfileInfo readICCProfileInfo(InputStream is) throws IOException {
+ private IccProfileInfo readIccProfileInfo(InputStream is) throws IOException {
final CachingInputStream cis = new CachingInputStream(is);
is = cis;
[commons-imaging] 26/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 21858572e067b403f51ba936a3c9ad7a4726373e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:15:14 2023 -0400
Use Java camel-case naming conventions
---
.../imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java | 4 ++--
.../tiff/taginfos/{TagInfoLongOrIFD.java => TagInfoLongOrIfd.java} | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java
index 5795d2c9..aaae5d96 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java
@@ -24,7 +24,7 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfo;
import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoAscii;
import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoBytes;
import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoLong;
-import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoLongOrIFD;
+import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoLongOrIfd;
import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShort;
/**
@@ -39,7 +39,7 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShort;
*/
public final class AdobePageMaker6TagConstants {
- public static final TagInfoLongOrIFD TIFF_TAG_SUB_IFD = new TagInfoLongOrIFD(
+ public static final TagInfoLongOrIfd TIFF_TAG_SUB_IFD = new TagInfoLongOrIfd(
"SubIFDs", 0x014a, -1,
TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true);
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLongOrIFD.java b/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLongOrIfd.java
similarity index 90%
rename from src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLongOrIFD.java
rename to src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLongOrIfd.java
index 22a57aed..0bb2220f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLongOrIFD.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLongOrIfd.java
@@ -23,12 +23,12 @@ import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
import org.apache.commons.imaging.formats.tiff.fieldtypes.FieldType;
-public class TagInfoLongOrIFD extends TagInfo {
- public TagInfoLongOrIFD(final String name, final int tag, final int length, final TiffDirectoryType directoryType) {
+public class TagInfoLongOrIfd extends TagInfo {
+ public TagInfoLongOrIfd(final String name, final int tag, final int length, final TiffDirectoryType directoryType) {
super(name, tag, FieldType.LONG_OR_IFD, length, directoryType);
}
- public TagInfoLongOrIFD(final String name, final int tag, final int length, final TiffDirectoryType directoryType, final boolean isOffset) {
+ public TagInfoLongOrIfd(final String name, final int tag, final int length, final TiffDirectoryType directoryType, final boolean isOffset) {
super(name, tag, FieldType.LONG_OR_IFD, length, directoryType, isOffset);
}
[commons-imaging] 14/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 ee62b8a3bfcad03d587813e7ab9488346ab10a27
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:58:40 2023 -0400
Use Java camel-case naming conventions
---
.../apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index bac123f3..30e33a41 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -205,7 +205,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
return v;
}
- private void readMCU(final JpegInputStream is, final int[] preds, final Block[] mcu)
+ private void readMcu(final JpegInputStream is, final int[] preds, final Block[] mcu)
throws ImagingException {
for (int i = 0; i < sosSegment.numberOfComponents; i++) {
final SosSegment.Component scanComponent = sosSegment.getComponents(i);
@@ -306,7 +306,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
return v;
}
- private void rescaleMCU(final Block[] dataUnits, final int hSize, final int vSize, final Block[] ret) {
+ private void rescaleMcu(final Block[] dataUnits, final int hSize, final int vSize, final Block[] ret) {
for (int i = 0; i < dataUnits.length; i++) {
final Block dataUnit = dataUnits[i];
if (dataUnit.width == hSize && dataUnit.height == vSize) {
@@ -492,8 +492,8 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
}
}
- readMCU(bitInputStream, preds, mcu);
- rescaleMCU(mcu, hSize, vSize, scaledMCU);
+ readMcu(bitInputStream, preds, mcu);
+ rescaleMcu(mcu, hSize, vSize, scaledMCU);
int srcRowOffset = 0;
int dstRowOffset = y1 * sofnSegment.width + x1;
for (int y2 = 0; y2 < vSize && y1 + y2 < sofnSegment.height; y2++) {
[commons-imaging] 02/33: Better name
Posted by gg...@apache.org.
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 ba04cbeef45fde95f7d5488011b4f076a60e5f51
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:38:53 2023 -0400
Better name
---
.../apache/commons/imaging/common/ImageBuilder.java | 4 ++--
.../commons/imaging/formats/bmp/PixelParserRle.java | 2 +-
.../commons/imaging/formats/bmp/PixelParserSimple.java | 2 +-
.../commons/imaging/formats/gif/GifImageParser.java | 2 +-
.../commons/imaging/formats/icns/IcnsDecoder.java | 14 +++++++-------
.../apache/commons/imaging/formats/pnm/FileInfo.java | 4 ++--
.../formats/tiff/datareaders/DataReaderStrips.java | 4 ++--
.../formats/tiff/datareaders/DataReaderTiled.java | 4 ++--
.../PhotometricInterpreterBiLevel.java | 2 +-
.../PhotometricInterpreterCieLab.java | 2 +-
.../PhotometricInterpreterCmyk.java | 2 +-
.../PhotometricInterpreterLogLuv.java | 2 +-
.../PhotometricInterpreterPalette.java | 2 +-
.../PhotometricInterpreterRgb.java | 2 +-
.../PhotometricInterpreterYCbCr.java | 2 +-
.../floatingpoint/PhotometricInterpreterFloat.java | 6 +++---
.../commons/imaging/common/ImageBuilderTest.java | 8 ++++----
.../examples/tiff/ExampleReadFloatingPointData.java | 2 +-
.../formats/tiff/TiffFloatingPointRoundTripTest.java | 2 +-
.../PhotometricInterpreterLogLuvTest.java | 2 +-
.../PhotometricInterpreterRgbTest.java | 2 +-
.../floatingpoint/PhotometricInterpreterFloatTest.java | 18 +++++++++---------
22 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java b/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
index 68537c4e..121c3b73 100644
--- a/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
+++ b/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
@@ -180,7 +180,7 @@ public class ImageBuilder {
* @param y the Y coordinate of the pixel to be read
* @return the RGB or ARGB pixel value
*/
- public int getRGB(final int x, final int y) {
+ public int getRgb(final int x, final int y) {
final int rowOffset = y * width;
return data[rowOffset + x];
}
@@ -302,7 +302,7 @@ public class ImageBuilder {
* @throws ArithmeticException if the index computation overflows an int.
* @throws IllegalArgumentException if the resulting index is illegal.
*/
- public void setRGB(final int x, final int y, final int argb) {
+ public void setRgb(final int x, final int y, final int argb) {
// Throw ArithmeticException if the result overflows an int.
final int rowOffset = Math.multiplyExact(y, width);
// Throw ArithmeticException if the result overflows an int.
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
index af5df033..7483bf4d 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
@@ -74,7 +74,7 @@ class PixelParserRle extends PixelParser {
// rgb = getNextRGB();
final int rgb = rgbs[i % rgbs.length];
// bi.setRGB(x, y, rgb);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
// bi.setRGB(x, y, 0xff00ff00);
} else {
LOGGER.fine("skipping bad pixel (" + x + "," + y + ")");
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
index 2887404b..ab184e79 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
@@ -36,7 +36,7 @@ abstract class PixelParserSimple extends PixelParser {
for (int x = 0; x < bhi.width; x++) {
final int rgb = getNextRGB();
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
// db.setElem(y * bhi.width + x, rgb);
}
newline();
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 2112b760..622eb659 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
@@ -333,7 +333,7 @@ public class GifImageParser extends ImageParser<GifImagingParameters> implements
if (transparentIndex == index) {
rgb = 0x00;
}
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java
index fa3f374e..4a5fb498 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java
@@ -111,7 +111,7 @@ final class IcnsDecoder {
}
value <<= 1;
bitsLeft--;
- image.setRGB(x, y, (alpha << 24) | (0xffffff & image.getRGB(x, y)));
+ image.setRgb(x, y, (alpha << 24) | (0xffffff & image.getRgb(x, y)));
}
}
}
@@ -120,8 +120,8 @@ final class IcnsDecoder {
for (int y = 0; y < image.getHeight(); y++) {
for (int x = 0; x < image.getWidth(); x++) {
final int alpha = 0xff & maskData[y * image.getWidth() + x];
- image.setRGB(x, y,
- (alpha << 24) | (0xffffff & image.getRGB(x, y)));
+ image.setRgb(x, y,
+ (alpha << 24) | (0xffffff & image.getRgb(x, y)));
}
}
}
@@ -144,7 +144,7 @@ final class IcnsDecoder {
}
value <<= 1;
bitsLeft--;
- image.setRGB(x, y, argb);
+ image.setRgb(x, y, argb);
}
}
}
@@ -156,7 +156,7 @@ final class IcnsDecoder {
| ((0xff & imageData[4 * (y * imageType.getWidth() + x) + 1]) << 16)
| ((0xff & imageData[4 * (y * imageType.getWidth() + x) + 2]) << 8)
| (0xff & imageData[4 * (y * imageType.getWidth() + x) + 3]);
- image.setRGB(x, y, argb);
+ image.setRgb(x, y, argb);
}
}
}
@@ -173,7 +173,7 @@ final class IcnsDecoder {
index = 0xf & imageData[i++];
}
visited = !visited;
- image.setRGB(x, y, PALETTE_4BPP[index]);
+ image.setRgb(x, y, PALETTE_4BPP[index]);
}
}
}
@@ -182,7 +182,7 @@ final class IcnsDecoder {
for (int y = 0; y < imageType.getHeight(); y++) {
for (int x = 0; x < imageType.getWidth(); x++) {
final int index = 0xff & imageData[y * imageType.getWidth() + x];
- image.setRGB(x, y, PALETTE_8BPP[index]);
+ image.setRgb(x, y, PALETTE_8BPP[index]);
}
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
index 27c2f525..393d1e5f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
@@ -100,7 +100,7 @@ abstract class FileInfo {
for (int x = 0; x < width; x++) {
final int rgb = getRGB(wsr);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
// count++;
}
newline();
@@ -110,7 +110,7 @@ abstract class FileInfo {
// System.out.println("y: " + y);
for (int x = 0; x < width; x++) {
final int rgb = getRGB(is);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
// count++;
}
newline();
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderStrips.java b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderStrips.java
index 09436387..c599fdfe 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderStrips.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderStrips.java
@@ -193,7 +193,7 @@ public final class DataReaderStrips extends ImageDataReader {
| (bytes[k] << 16)
| ((bytes[k + 1] & 0xff) << 8)
| (bytes[k + 2] & 0xff);
- imageBuilder.setRGB(j, i, rgb);
+ imageBuilder.setRgb(j, i, rgb);
}
}
} else {
@@ -206,7 +206,7 @@ public final class DataReaderStrips extends ImageDataReader {
| ((bytes[k + 1] & 0xff) << 8)
| (bytes[k + 2] & 0xff)
| (bytes[k + 3] << 24);
- imageBuilder.setRGB(j, i, rgb);
+ imageBuilder.setRgb(j, i, rgb);
}
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderTiled.java b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderTiled.java
index 7c86e4d2..f2de7d52 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderTiled.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/DataReaderTiled.java
@@ -155,7 +155,7 @@ public final class DataReaderTiled extends ImageDataReader {
| (bytes[k] << 16)
| ((bytes[k + 1] & 0xff) << 8)
| (bytes[k + 2] & 0xff);
- imageBuilder.setRGB(j, i, rgb);
+ imageBuilder.setRgb(j, i, rgb);
}
}
} else if (bitsPerPixel == 32) {
@@ -169,7 +169,7 @@ public final class DataReaderTiled extends ImageDataReader {
| ((bytes[k + 1] & 0xff) << 8)
| (bytes[k + 2] & 0xff)
| (bytes[k + 3] << 24);
- imageBuilder.setRGB(j, i, rgb);
+ imageBuilder.setRgb(j, i, rgb);
}
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java
index b9a9f862..a7770f70 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java
@@ -51,6 +51,6 @@ public class PhotometricInterpreterBiLevel extends PhotometricInterpreter {
final int alpha = 0xff;
final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java
index bd57041e..80f0f2a4 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCieLab.java
@@ -36,7 +36,7 @@ public class PhotometricInterpreterCieLab extends PhotometricInterpreter {
final int cieB = (byte) samples[2];
final int rgb = ColorConversions.convertCieLabToArgbTest(cieL, cieA, cieB);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java
index b3863360..ea2eb06d 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterCmyk.java
@@ -38,7 +38,7 @@ public class PhotometricInterpreterCmyk extends PhotometricInterpreter {
final int sk = samples[3];
final int rgb = ColorConversions.convertCmykToRgb(sc, sm, sy, sk);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java
index ad28fdab..b9b7578f 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuv.java
@@ -182,7 +182,7 @@ public class PhotometricInterpreterLogLuv extends PhotometricInterpreter {
final int blue = Math.min(255, Math.max(0, rgbValues.b));
final int alpha = 0xff;
final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java
index 57bf7328..ad000e57 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java
@@ -96,6 +96,6 @@ public class PhotometricInterpreterPalette extends PhotometricInterpreter {
@Override
public void interpretPixel(final ImageBuilder imageBuilder, final int[] samples, final int x, final int y)
throws ImagingException, IOException {
- imageBuilder.setRGB(x, y, indexColorMap[samples[0] & bitsPerPixelMask]);
+ imageBuilder.setRgb(x, y, indexColorMap[samples[0] & bitsPerPixelMask]);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java
index 9f2fc60b..9395afd6 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgb.java
@@ -36,7 +36,7 @@ public class PhotometricInterpreterRgb extends PhotometricInterpreter {
final int alpha = 0xff;
final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java
index aab5059d..c02cb9f7 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java
@@ -79,7 +79,7 @@ public class PhotometricInterpreterYCbCr extends PhotometricInterpreter {
final int alpha = 0xff;
final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java
index 5b37613b..b4bd23bd 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloat.java
@@ -226,7 +226,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
for (final PaletteEntry entry : singleValuePaletteEntries) {
if (entry.isCovered(f)) {
final int p = entry.getARGB(f);
- imageBuilder.setRGB(x, y, p);
+ imageBuilder.setRgb(x, y, p);
return;
}
}
@@ -252,7 +252,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
for (final PaletteEntry entry : singleValuePaletteEntries) {
if (entry.isCovered(f)) {
final int p = entry.getARGB(f);
- imageBuilder.setRGB(x, y, p);
+ imageBuilder.setRgb(x, y, p);
return;
}
}
@@ -260,7 +260,7 @@ public class PhotometricInterpreterFloat extends PhotometricInterpreter {
for (final PaletteEntry entry : rangePaletteEntries) {
if (entry.isCovered(f)) {
final int p = entry.getARGB(f);
- imageBuilder.setRGB(x, y, p);
+ imageBuilder.setRgb(x, y, p);
break;
}
}
diff --git a/src/test/java/org/apache/commons/imaging/common/ImageBuilderTest.java b/src/test/java/org/apache/commons/imaging/common/ImageBuilderTest.java
index 2606096d..f699243c 100644
--- a/src/test/java/org/apache/commons/imaging/common/ImageBuilderTest.java
+++ b/src/test/java/org/apache/commons/imaging/common/ImageBuilderTest.java
@@ -55,7 +55,7 @@ public class ImageBuilderTest {
for (int y = 0; y < 100; y++) {
final int k = y * 100 + x;
final int rgb = 0xff000000 | k;
- imageBuilder.setRGB(x, y, rgb);
+ imageBuilder.setRgb(x, y, rgb);
}
}
}
@@ -127,7 +127,7 @@ public class ImageBuilderTest {
for (int x = 25; x < 50; x++) {
for (int y = 25; y < 50; y++) {
final int k = bImage.getRGB(x - 25, y - 25);
- final int rgb = imageBuilder.getRGB(x, y);
+ final int rgb = imageBuilder.getRgb(x, y);
assertEquals(k, rgb, "Invalid buffered image subpixel at " + x + ", " + y);
}
}
@@ -135,8 +135,8 @@ public class ImageBuilderTest {
final ImageBuilder testBuilder = imageBuilder.getSubset(25, 25, 25, 25);
for (int x = 25; x < 50; x++) {
for (int y = 25; y < 50; y++) {
- final int k = testBuilder.getRGB(x - 25, y - 25);
- final int rgb = imageBuilder.getRGB(x, y);
+ final int k = testBuilder.getRgb(x - 25, y - 25);
+ final int rgb = imageBuilder.getRgb(x, y);
assertEquals(k, rgb, "Invalid image builder subpixel at " + x + ", " + y);
}
}
diff --git a/src/test/java/org/apache/commons/imaging/examples/tiff/ExampleReadFloatingPointData.java b/src/test/java/org/apache/commons/imaging/examples/tiff/ExampleReadFloatingPointData.java
index e548f47a..ca9974a2 100644
--- a/src/test/java/org/apache/commons/imaging/examples/tiff/ExampleReadFloatingPointData.java
+++ b/src/test/java/org/apache/commons/imaging/examples/tiff/ExampleReadFloatingPointData.java
@@ -175,7 +175,7 @@ public class ExampleReadFloatingPointData {
final float f = rasterData.getValue(x, y);
final int argb
= photometricInterpreter.mapValueToARGB(f);
- builder.setRGB(x, y, argb);
+ builder.setRgb(x, y, argb);
}
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java
index 1367ea19..866696c2 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java
@@ -82,7 +82,7 @@ public class TiffFloatingPointRoundTripTest extends TiffBaseTest {
final int index = iRow * width + iCol;
samples[0] = Float.floatToRawIntBits(f[index]);
pi.interpretPixel(builder, samples, iCol, iRow);
- argb[index] = builder.getRGB(iCol, iRow);
+ argb[index] = builder.getRgb(iCol, iRow);
}
}
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuvTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuvTest.java
index 40c06394..21bd9ca5 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuvTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLuvTest.java
@@ -94,7 +94,7 @@ public class PhotometricInterpreterLogLuvTest {
final int x = 10;
final int y = 20;
p.interpretPixel(imgBuilder, new int[] {100, (byte) 32, (byte) 2}, x, y);
- assertEquals(-7584166, imgBuilder.getRGB(x, y));
+ assertEquals(-7584166, imgBuilder.getRgb(x, y));
}
@Test
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgbTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgbTest.java
index 2584c838..91c6f82e 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgbTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterRgbTest.java
@@ -58,6 +58,6 @@ public class PhotometricInterpreterRgbTest {
final int x = 10;
final int y = 20;
p.interpretPixel(imgBuilder, new int[] {255, 255, 255}, x, y);
- assertEquals(0xffffffff, imgBuilder.getRGB(x, y));
+ assertEquals(0xffffffff, imgBuilder.getRgb(x, y));
}
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloatTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloatTest.java
index 9ab216c8..2a1f4579 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloatTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/floatingpoint/PhotometricInterpreterFloatTest.java
@@ -184,7 +184,7 @@ public class PhotometricInterpreterFloatTest {
public void testInterpretPixel() {
for (int i = 0; i < 256; i++) {
final int lowTest = (i / 32) * 32;
- final int argb = imageBuilder.getRGB(i, i);
+ final int argb = imageBuilder.getRgb(i, i);
final int b = argb & 0xff;
assertEquals(b, lowTest, "Invalid conversion for level " + i);
}
@@ -194,17 +194,17 @@ public class PhotometricInterpreterFloatTest {
// in the range 224.0/256.0 <= value < 256.0/256.0. So when it
// was rendered, there was not palette entry that matched it,
// and the corresponding pixel was set to zero.
- int argb = imageBuilder.getRGB(256, 256);
+ int argb = imageBuilder.getRgb(256, 256);
assertEquals(argb, 0, "Invalid upper-bound test");
// Now inspect the banded palette case
- argb = bandedImageBuilder.getRGB(0, 0);
+ argb = bandedImageBuilder.getRgb(0, 0);
assertEquals(Color.gray.getRGB(), argb, "Invalid mapping of NaN");
- argb = bandedImageBuilder.getRGB(50, 10);
+ argb = bandedImageBuilder.getRgb(50, 10);
assertEquals(green.getRGB(), argb, "Invalid mapping of green range");
- argb = bandedImageBuilder.getRGB(150, 10);
+ argb = bandedImageBuilder.getRgb(150, 10);
assertEquals(Color.white.getRGB(), argb, "Invalid mapping of white range");
- argb = bandedImageBuilder.getRGB(250, 10);
+ argb = bandedImageBuilder.getRgb(250, 10);
assertEquals(orange.getRGB(), argb, "Invalid mapping of orange range");
}
@@ -215,7 +215,7 @@ public class PhotometricInterpreterFloatTest {
public void testMapValueToARGB() {
int argb = pInterp.mapValueToARGB(0.5f);
- int test = imageBuilder.getRGB(128, 128);
+ int test = imageBuilder.getRgb(128, 128);
assertEquals(test, argb, "Conflicting results from value-to-ARGB map");
// pInterp does not define a state for NaN, but bandedInterp does.
@@ -251,8 +251,8 @@ public class PhotometricInterpreterFloatTest {
interpreter.interpretPixel(imageBuilder, samples, 0, 0);
samples[0] = Float.floatToRawIntBits(1.2f);
interpreter.interpretPixel(imageBuilder, samples, 1, 1);
- int argb0 = imageBuilder.getRGB(0, 0) | 0xff000000;
- int argb1 = imageBuilder.getRGB(1, 1) | 0xff000000;
+ int argb0 = imageBuilder.getRgb(0, 0) | 0xff000000;
+ int argb1 = imageBuilder.getRgb(1, 1) | 0xff000000;
assertEquals(argb0, c0.getRGB(), "Invalid result for overlapping palette entry 0");
assertEquals(argb1, c1.getRGB(), "Invalid result for overlapping palette entry 1");
argb0 = interpreter.mapValueToARGB(0.5f);
[commons-imaging] 09/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 aec1e56d86bd5f438477080b516f15a11436d1c5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:54:12 2023 -0400
Use Java camel-case naming conventions
---
.../imaging/formats/jpeg/JpegImageParser.java | 30 +++++++++++-----------
.../commons/imaging/formats/jpeg/JpegUtils.java | 18 ++++++-------
.../imaging/formats/jpeg/decoder/JpegDecoder.java | 6 ++---
.../imaging/formats/jpeg/exif/ExifRewriter.java | 6 ++---
.../imaging/formats/jpeg/xmp/JpegRewriter.java | 6 ++---
.../imaging/formats/jpeg/exif/ExifDumpTest.java | 2 +-
.../imaging/formats/jpeg/exif/ExifRewriteTest.java | 14 +++++-----
7 files changed, 41 insertions(+), 41 deletions(-)
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 1bae1255..848e9ef5 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
@@ -751,7 +751,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return false;
}
@@ -775,12 +775,12 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes,
+ public void visitSos(final int marker, final byte[] markerBytes,
final byte[] imageData) {
// don't need image data
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
if (result.isEmpty()) {
return null;
@@ -799,7 +799,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return false;
}
@@ -823,13 +823,13 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes,
+ public void visitSos(final int marker, final byte[] markerBytes,
final byte[] imageData) {
// don't need image data
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
return result[0];
}
@@ -841,7 +841,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return false;
}
@@ -865,13 +865,13 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes,
+ public void visitSos(final int marker, final byte[] markerBytes,
final byte[] imageData) {
// don't need image data
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
return result[0];
}
@@ -883,7 +883,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return false;
}
@@ -907,12 +907,12 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes,
+ public void visitSos(final int marker, final byte[] markerBytes,
final byte[] imageData) {
// don't need image data
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
return result[0];
}
@@ -953,7 +953,7 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return false;
}
@@ -1008,13 +1008,13 @@ public class JpegImageParser extends ImageParser<JpegImagingParameters> implemen
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes,
+ public void visitSos(final int marker, final byte[] markerBytes,
final byte[] imageData) {
// don't need image data
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
return result;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
index 0662d9bd..5622a14e 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
@@ -31,7 +31,7 @@ import org.apache.commons.io.IOUtils;
public class JpegUtils extends BinaryFileParser {
public interface Visitor {
// return false to exit before reading image data.
- boolean beginSOS();
+ boolean beginSos();
// return false to exit traversal.
boolean visitSegment(int marker, byte[] markerBytes,
@@ -39,7 +39,7 @@ public class JpegUtils extends BinaryFileParser {
byte[] segmentData) throws ImagingException,
IOException;
- void visitSOS(int marker, byte[] markerBytes, byte[] imageData);
+ void visitSos(int marker, byte[] markerBytes, byte[] imageData);
}
public static String getMarkerName(final int marker) {
@@ -123,12 +123,12 @@ public class JpegUtils extends BinaryFileParser {
super(ByteOrder.BIG_ENDIAN);
}
- public void dumpJFIF(final ByteSource byteSource) throws ImagingException,
+ public void dumpJfif(final ByteSource byteSource) throws ImagingException,
IOException {
final Visitor visitor = new Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return true;
}
@@ -144,16 +144,16 @@ public class JpegUtils extends BinaryFileParser {
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes, final byte[] imageData) {
+ public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
Debug.debug("SOS marker. " + imageData.length + " bytes of image data.");
Debug.debug("");
}
};
- traverseJFIF(byteSource, visitor);
+ traverseJfif(byteSource, visitor);
}
- public void traverseJFIF(final ByteSource byteSource, final Visitor visitor) throws ImagingException, IOException {
+ public void traverseJfif(final ByteSource byteSource, final Visitor visitor) throws ImagingException, IOException {
try (InputStream is = byteSource.getInputStream()) {
BinaryFunctions.readAndVerifyBytes(is, JpegConstants.SOI, "Not a Valid JPEG File: doesn't begin with 0xffd8");
@@ -167,12 +167,12 @@ public class JpegUtils extends BinaryFileParser {
final int marker = ((0xff & markerBytes[0]) << 8) | (0xff & markerBytes[1]);
if (marker == JpegConstants.EOI_MARKER || marker == JpegConstants.SOS_MARKER) {
- if (!visitor.beginSOS()) {
+ if (!visitor.beginSos()) {
return;
}
final byte[] imageData = IOUtils.toByteArray(is);
- visitor.visitSOS(marker, markerBytes, imageData);
+ visitor.visitSos(marker, markerBytes, imageData);
break;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index edb86c7d..7a342f5e 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -164,14 +164,14 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
}
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return true;
}
public BufferedImage decode(final ByteSource byteSource) throws IOException,
ImagingException {
final JpegUtils jpegUtils = new JpegUtils();
- jpegUtils.traverseJFIF(byteSource, this);
+ jpegUtils.traverseJfif(byteSource, this);
if (imageReadException != null) {
throw imageReadException;
}
@@ -413,7 +413,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes, final byte[] imageData) {
+ public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
try (ByteArrayInputStream is = new ByteArrayInputStream(imageData)) {
// read the scan header
final int segmentLength = read2Bytes("segmentLength", is,"Not a Valid JPEG File", getByteOrder());
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
index bd307258..fcaab153 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
@@ -139,7 +139,7 @@ public class ExifRewriter extends BinaryFileParser {
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return true;
}
@@ -171,12 +171,12 @@ public class ExifRewriter extends BinaryFileParser {
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes, final byte[] imageData) {
+ public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
pieces.add(new JFIFPieceImageData(markerBytes, imageData));
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
// GenericSegment exifSegment = exifSegmentArray[0];
// if (exifSegments.size() < 1)
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 1b5fd81b..c3a1a792 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
@@ -176,7 +176,7 @@ public class JpegRewriter extends BinaryFileParser {
final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
// return false to exit before reading image data.
@Override
- public boolean beginSOS() {
+ public boolean beginSos() {
return true;
}
@@ -194,12 +194,12 @@ public class JpegRewriter extends BinaryFileParser {
}
@Override
- public void visitSOS(final int marker, final byte[] markerBytes, final byte[] imageData) {
+ public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
pieces.add(new JFIFPieceImageData(markerBytes, imageData));
}
};
- new JpegUtils().traverseJFIF(byteSource, visitor);
+ new JpegUtils().traverseJfif(byteSource, visitor);
return new JFIFPieces(pieces, segmentPieces);
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java
index 85821a67..99627e35 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java
@@ -42,7 +42,7 @@ public class ExifDumpTest extends ExifBaseTest {
public void testDumpJFIF(final File imageFile) throws Exception {
final ByteSource byteSource = ByteSource.file(imageFile);
Debug.debug("Segments:");
- new JpegUtils().dumpJFIF(byteSource);
+ new JpegUtils().dumpJfif(byteSource);
// TODO assert something
}
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
index 3c05a59b..a6397994 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
@@ -209,7 +209,7 @@ public class ExifRewriteTest extends ExifBaseTest {
final ByteSource byteSource = ByteSource.file(imageFile);
Debug.debug("Source Segments:");
- new JpegUtils().dumpJFIF(byteSource);
+ new JpegUtils().dumpJfif(byteSource);
final JpegImageMetadata oldMetadata = (JpegImageMetadata) Imaging.getMetadata(imageFile);
if (null == oldMetadata) {
@@ -235,7 +235,7 @@ public class ExifRewriteTest extends ExifBaseTest {
final byte[] bytes = baos.toByteArray();
Debug.debug("Output Segments:");
- new JpegUtils().dumpJFIF(ByteSource.array(bytes));
+ new JpegUtils().dumpJfif(ByteSource.array(bytes));
// assertTrue(!hasExifData(tempFile));
@@ -269,7 +269,7 @@ public class ExifRewriteTest extends ExifBaseTest {
final ByteSource byteSource = ByteSource.file(imageFile);
Debug.debug("Source Segments:");
- new JpegUtils().dumpJFIF(byteSource);
+ new JpegUtils().dumpJfif(byteSource);
final JpegImageMetadata originalMetadata = (JpegImageMetadata) Imaging.getMetadata(imageFile);
assertNotNull(originalMetadata);
@@ -285,7 +285,7 @@ public class ExifRewriteTest extends ExifBaseTest {
Debug.debug("Output Segments:");
stripped = ByteSource.array(bytes);
- new JpegUtils().dumpJFIF(stripped);
+ new JpegUtils().dumpJfif(stripped);
assertFalse(hasExifData("removed.jpg", bytes));
}
@@ -302,7 +302,7 @@ public class ExifRewriteTest extends ExifBaseTest {
final byte[] bytes = baos.toByteArray();
Debug.debug("Output Segments:");
- new JpegUtils().dumpJFIF(ByteSource.array(bytes));
+ new JpegUtils().dumpJfif(ByteSource.array(bytes));
// assertTrue(!hasExifData(tempFile));
@@ -332,7 +332,7 @@ public class ExifRewriteTest extends ExifBaseTest {
final ByteSource byteSource = ByteSource.file(imageFile);
Debug.debug("Source Segments:");
- new JpegUtils().dumpJFIF(byteSource);
+ new JpegUtils().dumpJfif(byteSource);
{
final JpegImageMetadata metadata = (JpegImageMetadata) Imaging.getMetadata(imageFile);
@@ -345,7 +345,7 @@ public class ExifRewriteTest extends ExifBaseTest {
final byte[] bytes = baos.toByteArray();
Debug.debug("Output Segments:");
- new JpegUtils().dumpJFIF(ByteSource.array(bytes));
+ new JpegUtils().dumpJfif(ByteSource.array(bytes));
assertFalse(hasExifData("test.jpg", bytes));
}
[commons-imaging] 23/33: Use Java camel-case naming conventions
Posted by gg...@apache.org.
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 af1f5def0f3a35aeabcea5a1d1cac5ad2e7a0d19
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:13:18 2023 -0400
Use Java camel-case naming conventions
---
.../java/org/apache/commons/imaging/formats/pnm/FileInfo.java | 10 +++++-----
.../org/apache/commons/imaging/formats/pnm/PamFileInfo.java | 6 +++---
.../org/apache/commons/imaging/formats/pnm/PbmFileInfo.java | 6 +++---
.../org/apache/commons/imaging/formats/pnm/PgmFileInfo.java | 6 +++---
.../org/apache/commons/imaging/formats/pnm/PnmImageParser.java | 2 +-
.../org/apache/commons/imaging/formats/pnm/PpmFileInfo.java | 6 +++---
.../apache/commons/imaging/formats/pnm/PbmFileInfoTest.java | 2 +-
7 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
index 393d1e5f..a014f17a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
@@ -71,13 +71,13 @@ abstract class FileInfo {
abstract String getImageTypeDescription();
- abstract String getMIMEType();
+ abstract String getMimeType();
abstract int getNumComponents();
- abstract int getRGB(InputStream is) throws IOException;
+ abstract int getRgb(InputStream is) throws IOException;
- abstract int getRGB(WhiteSpaceReader wsr) throws IOException;
+ abstract int getRgb(WhiteSpaceReader wsr) throws IOException;
abstract boolean hasAlpha();
@@ -98,7 +98,7 @@ abstract class FileInfo {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
- final int rgb = getRGB(wsr);
+ final int rgb = getRgb(wsr);
imageBuilder.setRgb(x, y, rgb);
// count++;
@@ -109,7 +109,7 @@ abstract class FileInfo {
for (int y = 0; y < height; y++) {
// System.out.println("y: " + y);
for (int x = 0; x < width; x++) {
- final int rgb = getRGB(is);
+ final int rgb = getRgb(is);
imageBuilder.setRgb(x, y, rgb);
// count++;
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
index 066e0cce..5de54496 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
@@ -156,7 +156,7 @@ class PamFileInfo extends FileInfo {
}
@Override
- public String getMIMEType() {
+ public String getMimeType() {
return "image/x-portable-arbitrary-map";
}
@@ -166,12 +166,12 @@ class PamFileInfo extends FileInfo {
}
@Override
- public int getRGB(final InputStream is) throws IOException {
+ public int getRgb(final InputStream is) throws IOException {
return tupleReader.getRGB(is);
}
@Override
- public int getRGB(final WhiteSpaceReader wsr) throws IOException {
+ public int getRgb(final WhiteSpaceReader wsr) throws IOException {
throw new UnsupportedOperationException("PAM files are only ever binary");
}
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java
index aeb2b801..8a1524b2 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java
@@ -53,7 +53,7 @@ class PbmFileInfo extends FileInfo {
}
@Override
- public String getMIMEType() {
+ public String getMimeType() {
return "image/x-portable-bitmap";
}
@@ -63,7 +63,7 @@ class PbmFileInfo extends FileInfo {
}
@Override
- public int getRGB(final InputStream is) throws IOException {
+ public int getRgb(final InputStream is) throws IOException {
if (bitsInCache < 1) {
final int bits = is.read();
if (bits < 0) {
@@ -87,7 +87,7 @@ class PbmFileInfo extends FileInfo {
}
@Override
- public int getRGB(final WhiteSpaceReader wsr) throws IOException {
+ public int getRgb(final WhiteSpaceReader wsr) throws IOException {
final int bit = Integer.parseInt(wsr.readtoWhiteSpace());
if (bit == 0) {
return 0xff000000;
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java
index 19e35894..9ba1500a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java
@@ -69,7 +69,7 @@ class PgmFileInfo extends FileInfo {
}
@Override
- public String getMIMEType() {
+ public String getMimeType() {
return "image/x-portable-graymap";
}
@@ -79,7 +79,7 @@ class PgmFileInfo extends FileInfo {
}
@Override
- public int getRGB(final InputStream is) throws IOException {
+ public int getRgb(final InputStream is) throws IOException {
int sample = readSample(is, bytesPerSample);
sample = scaleSample(sample, scale, max);
@@ -93,7 +93,7 @@ class PgmFileInfo extends FileInfo {
}
@Override
- public int getRGB(final WhiteSpaceReader wsr) throws IOException {
+ public int getRgb(final WhiteSpaceReader wsr) throws IOException {
int sample = Integer.parseInt(wsr.readtoWhiteSpace());
sample = scaleSample(sample, scale, max);
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 955156d0..3cefdc5d 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
@@ -131,7 +131,7 @@ public class PnmImageParser extends ImageParser<PnmImagingParameters> {
final int bitsPerPixel = info.getBitDepth() * info.getNumComponents();
final ImageFormat format = info.getImageType();
final String formatName = info.getImageTypeDescription();
- final String mimeType = info.getMIMEType();
+ final String mimeType = info.getMimeType();
final int numberOfImages = 1;
final boolean progressive = false;
diff --git a/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java b/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java
index 23c0af2d..bd6843c2 100644
--- a/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java
@@ -67,7 +67,7 @@ class PpmFileInfo extends FileInfo {
}
@Override
- public String getMIMEType() {
+ public String getMimeType() {
return "image/x-portable-pixmap";
}
@@ -77,7 +77,7 @@ class PpmFileInfo extends FileInfo {
}
@Override
- public int getRGB(final InputStream is) throws IOException {
+ public int getRgb(final InputStream is) throws IOException {
int red = readSample(is, bytesPerSample);
int green = readSample(is, bytesPerSample);
int blue = readSample(is, bytesPerSample);
@@ -94,7 +94,7 @@ class PpmFileInfo extends FileInfo {
}
@Override
- public int getRGB(final WhiteSpaceReader wsr) throws IOException {
+ public int getRgb(final WhiteSpaceReader wsr) throws IOException {
int red = Integer.parseInt(wsr.readtoWhiteSpace());
int green = Integer.parseInt(wsr.readtoWhiteSpace());
int blue = Integer.parseInt(wsr.readtoWhiteSpace());
diff --git a/src/test/java/org/apache/commons/imaging/formats/pnm/PbmFileInfoTest.java b/src/test/java/org/apache/commons/imaging/formats/pnm/PbmFileInfoTest.java
index 78ab8be0..8125c09f 100644
--- a/src/test/java/org/apache/commons/imaging/formats/pnm/PbmFileInfoTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/pnm/PbmFileInfoTest.java
@@ -35,7 +35,7 @@ public class PbmFileInfoTest{
inputStream.read(byteArray);
try {
- pbmFileInfo.getRGB(inputStream);
+ pbmFileInfo.getRgb(inputStream);
fail("Expecting exception: IOException");
} catch (final IOException e) {
assertEquals("PBM: Unexpected EOF",e.getMessage());
[commons-imaging] 33/33: No need to initialize to default value
Posted by gg...@apache.org.
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 bf27ed877a34e3191a2737f43db619477154ca17
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 15:21:16 2023 -0400
No need to initialize to default value
---
.../org/apache/commons/imaging/formats/xpm/XpmImageParser.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java b/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
index 7fd48ca8..05c9ec2c 100644
--- a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
@@ -57,10 +57,10 @@ public class XpmImageParser extends ImageParser<XpmImagingParameters> {
int colorArgb;
int gray4LevelArgb;
int grayArgb;
- boolean haveColor = false;
- boolean haveGray = false;
- boolean haveGray4Level = false;
- boolean haveMono = false;
+ boolean haveColor;
+ boolean haveGray;
+ boolean haveGray4Level;
+ boolean haveMono;
int index;
int monoArgb;
[commons-imaging] 01/33: Better name
Posted by gg...@apache.org.
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 e085ffa3e4ae43d00a280e50968d645d43cdebcc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 4 14:38:09 2023 -0400
Better name
---
src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
index ff64f36a..689a4a91 100644
--- a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
+++ b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
@@ -69,7 +69,7 @@ public final class BinaryFunctions {
return findNull(src, 0, message);
}
- public static byte[] getRAFBytes(final RandomAccessFile raf, final long pos,
+ public static byte[] getBytes(final RandomAccessFile raf, final long pos,
final int length, final String exception) throws IOException {
if (length < 0) {
throw new IOException(String.format("%s, invalid length: %d", exception, length));