You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2018/08/25 10:40:50 UTC
[03/14] commons-imaging git commit: IMAGING-103: for checkstyle,
remove trailing space
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java
----------------------------------------------------------------------
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 39700b2..7ca8a43 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
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -173,7 +173,7 @@ public class XbmImageParser extends ImageParser {
return xbmParseResult;
}
}
-
+
private static int parseCIntegerLiteral(String value) {
if (value.startsWith("0")) {
if (value.length() >= 2) {
@@ -300,7 +300,7 @@ public class XbmImageParser extends ImageParser {
final ColorModel colorModel = new IndexColorModel(1, 2, palette, 0, false, -1, DataBuffer.TYPE_BYTE);
final DataBufferByte dataBuffer = new DataBufferByte(imageData, imageData.length);
final WritableRaster raster = Raster.createPackedRaster(dataBuffer, xbmHeader.width, xbmHeader.height, 1, null);
-
+
return new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), new Properties());
}
@@ -414,7 +414,7 @@ public class XbmImageParser extends ImageParser {
/**
* Extracts embedded XML metadata as XML string.
* <p>
- *
+ *
* @param byteSource
* File containing image data.
* @param params
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java
----------------------------------------------------------------------
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 7c78b45..8f098de 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
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -72,7 +72,7 @@ public class XpmImageParser extends ImageParser {
if (colorNames != null) {
return;
}
-
+
try {
final InputStream rgbTxtStream =
XpmImageParser.class.getResourceAsStream("rgb.txt");
@@ -361,7 +361,7 @@ public class XpmImageParser extends ImageParser {
return 0x00000000;
}
}
-
+
private void populatePaletteEntry(final PaletteEntry paletteEntry, final String key, final String color) throws ImageReadException {
if ("m".equals(key)) {
paletteEntry.monoArgb = parseColor(color);
@@ -399,11 +399,11 @@ public class XpmImageParser extends ImageParser {
for (int j = 0; j < tokens.length; j++) {
final String token = tokens[j];
boolean isKey = false;
- if (previousKeyIndex < (j - 1)
+ if (previousKeyIndex < (j - 1)
&& "m".equals(token)
- || "g4".equals(token)
+ || "g4".equals(token)
|| "g".equals(token)
- || "c".equals(token)
+ || "c".equals(token)
|| "s".equals(token)) {
isKey = true;
}
@@ -724,7 +724,7 @@ public class XpmImageParser extends ImageParser {
/**
* Extracts embedded XML metadata as XML string.
* <p>
- *
+ *
* @param byteSource
* File containing image data.
* @param params
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/icc/IccConstants.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/icc/IccConstants.java b/src/main/java/org/apache/commons/imaging/icc/IccConstants.java
index 787a129..e3ab397 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccConstants.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccConstants.java
@@ -21,7 +21,7 @@ public final class IccConstants {
| ((0xff & 'C') << 8) | ((0xff & ' ') << 0));
public static final int sRGB = (((0xff & 's') << 24) | ((0xff & 'R') << 16)
| ((0xff & 'G') << 8) | ((0xff & 'B') << 0));
-
+
private IccConstants() {
}
}
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java b/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
index 22f3a68..6363161 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
@@ -84,7 +84,7 @@ public class IccProfileInfo {
}
public boolean issRGB() {
- return deviceManufacturer == IccConstants.IEC
+ return deviceManufacturer == IccConstants.IEC
&& deviceModel == IccConstants.sRGB;
}
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
----------------------------------------------------------------------
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 3dee15e..efbafc6 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
@@ -137,7 +137,7 @@ public class IccProfileParser extends BinaryFileParser {
final int profileVersion = read4Bytes("ProfileVersion", is, "Not a Valid ICC Profile", getByteOrder());
- final int profileDeviceClassSignature = read4Bytes("ProfileDeviceClassSignature", is,
+ final int profileDeviceClassSignature = read4Bytes("ProfileDeviceClassSignature", is,
"Not a Valid ICC Profile", getByteOrder());
if (LOGGER.isLoggable(Level.FINEST)) {
printCharQuad("ProfileDeviceClassSignature", profileDeviceClassSignature);
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/icc/IccTag.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/icc/IccTag.java b/src/main/java/org/apache/commons/imaging/icc/IccTag.java
index e4570c0..5c9fcd5 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccTag.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccTag.java
@@ -54,9 +54,9 @@ public class IccTag {
data = bytes;
try (InputStream bis = new ByteArrayInputStream(bytes)) {
- dataTypeSignature = BinaryFunctions.read4Bytes("data type signature", bis,
+ dataTypeSignature = BinaryFunctions.read4Bytes("data type signature", bis,
"ICC: corrupt tag data", ByteOrder.BIG_ENDIAN);
-
+
itdt = getIccTagDataType(dataTypeSignature);
// if (itdt != null)
// {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/icc/IccTagDataTypes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/icc/IccTagDataTypes.java b/src/main/java/org/apache/commons/imaging/icc/IccTagDataTypes.java
index a23c6e1..7e65a7a 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccTagDataTypes.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccTagDataTypes.java
@@ -36,11 +36,11 @@ public enum IccTagDataTypes implements IccTagDataType {
{
try (InputStream bis = new ByteArrayInputStream(bytes)) {
read4Bytes("type_signature", bis, "ICC: corrupt tag data", ByteOrder.BIG_ENDIAN);
-
+
// bis.setDebug(true);
read4Bytes("ignore", bis, "ICC: corrupt tag data", ByteOrder.BIG_ENDIAN);
final int stringLength = read4Bytes("stringLength", bis, "ICC: corrupt tag data", ByteOrder.BIG_ENDIAN);
-
+
// bis.readByteArray("ignore", bytes.length -12, "none");
final String s = new String(bytes, 12, stringLength - 1, StandardCharsets.US_ASCII);
LOGGER.fine(prefix + "s: '" + s + "'");
@@ -125,12 +125,12 @@ public enum IccTagDataTypes implements IccTagDataType {
this.name = name;
this.signature = signature;
}
-
+
@Override
public String getName() {
return name;
}
-
+
@Override
public int getSignature() {
return signature;
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/icc/IccTagTypes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/icc/IccTagTypes.java b/src/main/java/org/apache/commons/imaging/icc/IccTagTypes.java
index 36d15a5..61cf96c 100644
--- a/src/main/java/org/apache/commons/imaging/icc/IccTagTypes.java
+++ b/src/main/java/org/apache/commons/imaging/icc/IccTagTypes.java
@@ -328,12 +328,12 @@ public enum IccTagTypes implements IccTagType {
public String getName() {
return name;
}
-
+
@Override
public String getTypeDescription() {
return typeDescription;
}
-
+
@Override
public int getSignature() {
return signature;
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/ColorComponent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/ColorComponent.java b/src/main/java/org/apache/commons/imaging/palette/ColorComponent.java
index 77ac38b..ba39bd8 100644
--- a/src/main/java/org/apache/commons/imaging/palette/ColorComponent.java
+++ b/src/main/java/org/apache/commons/imaging/palette/ColorComponent.java
@@ -21,7 +21,7 @@ enum ColorComponent {
RED(16),
GREEN(8),
BLUE(0);
-
+
private final int shift;
private ColorComponent(final int shift) {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java b/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java
index 6405aa9..e4e32c1 100644
--- a/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java
+++ b/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java
@@ -143,7 +143,7 @@ class ColorSpaceSubset {
for (int green = mins[1]; green <= maxs[1]; green++) {
for (int blue = mins[2]; blue <= maxs[2]; blue++) {
// note: order reversed
- final int idx = (blue << (2 * precision))
+ final int idx = (blue << (2 * precision))
| (green << (1 * precision))
| (red << (0 * precision));
final int count = table[idx];
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/Dithering.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/Dithering.java b/src/main/java/org/apache/commons/imaging/palette/Dithering.java
index 991c75e..381c431 100644
--- a/src/main/java/org/apache/commons/imaging/palette/Dithering.java
+++ b/src/main/java/org/apache/commons/imaging/palette/Dithering.java
@@ -26,7 +26,7 @@ import org.apache.commons.imaging.ImageWriteException;
public final class Dithering {
private Dithering() {
}
-
+
/**
* Changes the given image to only use colors from the given palette,
* applying Floyd-Steinberg dithering in the process. Ensure that
@@ -43,12 +43,12 @@ public final class Dithering {
final int index = palette.getPaletteIndex(argb);
final int nextArgb = palette.getEntry(index);
image.setRGB(x, y, nextArgb);
-
+
final int a = (argb >> 24) & 0xff;
final int r = (argb >> 16) & 0xff;
final int g = (argb >> 8) & 0xff;
final int b = argb & 0xff;
-
+
final int na = (nextArgb >> 24) & 0xff;
final int nr = (nextArgb >> 16) & 0xff;
final int ng = (nextArgb >> 8) & 0xff;
@@ -58,7 +58,7 @@ public final class Dithering {
final int errR = r - nr;
final int errG = g - ng;
final int errB = b - nb;
-
+
if (x + 1 < image.getWidth()) {
int update = adjustPixel(image.getRGB(x + 1, y), errA, errR, errG, errB, 7);
image.setRGB(x + 1, y, update);
@@ -79,7 +79,7 @@ public final class Dithering {
}
}
}
-
+
private static int adjustPixel(final int argb, final int errA, final int errR, final int errG, final int errB, final int mul) {
int a = (argb >> 24) & 0xff;
int r = (argb >> 16) & 0xff;
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/LongestAxisMedianCut.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/LongestAxisMedianCut.java b/src/main/java/org/apache/commons/imaging/palette/LongestAxisMedianCut.java
index 8b3b4c6..d1751d8 100644
--- a/src/main/java/org/apache/commons/imaging/palette/LongestAxisMedianCut.java
+++ b/src/main/java/org/apache/commons/imaging/palette/LongestAxisMedianCut.java
@@ -58,7 +58,7 @@ public class LongestAxisMedianCut implements MedianCut {
}
return true;
}
-
+
private void doCut(final ColorGroup colorGroup, final ColorComponent mode,
final List<ColorGroup> colorGroups, final boolean ignoreAlpha) throws ImageWriteException {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java b/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java
index aee4d72..cb8e1ba 100644
--- a/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java
+++ b/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java
@@ -81,7 +81,7 @@ public class MedianCutQuantizer {
}
throw new Error("");
}
-
+
public Palette process(final BufferedImage image, final int maxColors,
final MedianCut medianCut)
throws ImageWriteException {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.java b/src/main/java/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.java
index aa9eab0..f8defe9 100644
--- a/src/main/java/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.java
+++ b/src/main/java/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.java
@@ -42,9 +42,9 @@ public class MostPopulatedBoxesMedianCut implements MedianCut {
if (colorGroup == null) {
return false;
}
-
-
-
+
+
+
double bestScore = Double.MAX_VALUE;
ColorComponent bestColorComponent = null;
int bestMedianIndex = -1;
@@ -59,9 +59,9 @@ public class MostPopulatedBoxesMedianCut implements MedianCut {
int medianIndex;
for (medianIndex = 0; medianIndex < colorGroup.colorCounts.size(); medianIndex++) {
final ColorCount colorCount = colorGroup.colorCounts.get(medianIndex);
-
+
newCount += colorCount.count;
-
+
if (newCount < countHalf) {
oldCount = newCount;
} else {
@@ -100,7 +100,7 @@ public class MostPopulatedBoxesMedianCut implements MedianCut {
if (bestColorComponent == null) {
return false;
}
-
+
Collections.sort(colorGroup.colorCounts, new ColorComparer(bestColorComponent));
final List<ColorCount> lowerColors = new ArrayList<>(
colorGroup.colorCounts.subList(0, bestMedianIndex + 1));
@@ -112,7 +112,7 @@ public class MostPopulatedBoxesMedianCut implements MedianCut {
colorGroups.remove(colorGroup);
colorGroups.add(lowerGroup);
colorGroups.add(upperGroup);
-
+
final ColorCount medianValue = colorGroup.colorCounts.get(bestMedianIndex);
int limit;
switch (bestColorComponent) {
@@ -134,16 +134,16 @@ public class MostPopulatedBoxesMedianCut implements MedianCut {
colorGroup.cut = new ColorGroupCut(lowerGroup, upperGroup, bestColorComponent, limit);
return true;
}
-
+
private static class ColorComparer implements Comparator<ColorCount>, Serializable {
private static final long serialVersionUID = 1L;
-
+
private final ColorComponent colorComponent;
-
+
public ColorComparer(final ColorComponent colorComponent) {
this.colorComponent = colorComponent;
}
-
+
@Override
public int compare(final ColorCount c1, final ColorCount c2) {
switch (colorComponent) {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java b/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java
index 2bb9f2d..d00c62a 100644
--- a/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java
+++ b/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java
@@ -38,7 +38,7 @@ public class PaletteFactory {
private static final Logger LOGGER = Logger.getLogger(PaletteFactory.class.getName());
public static final int COMPONENTS = 3; // in bits
-
+
/**
* Builds an exact complete opaque palette containing all the colors in {@code src},
* using an algorithm that is faster than {@linkplain #makeExactRgbPaletteSimple} for large images
@@ -381,7 +381,7 @@ public class PaletteFactory {
return new QuantizedPalette(subsets, precision);
}
-
+
/**
* Builds an inexact possibly translucent palette of at most {@code max} colors in {@code src}
* using the traditional Median Cut algorithm. Color bounding boxes are split along the
@@ -421,7 +421,7 @@ public class PaletteFactory {
}
}
}
-
+
final int[] result = new int[rgbs.size()];
int next = 0;
for (final int rgb : rgbs) {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java b/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
index f5c2ab6..7f35af2 100644
--- a/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
+++ b/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java b/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
index bc36953..e6528c7 100644
--- a/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
+++ b/src/test/java/org/apache/commons/imaging/examples/ApacheImagingSpeedAndMemoryTest.java
@@ -17,12 +17,12 @@
/****************************************************************
* Explanation of Use and Rationale For Procedures
- *
+ *
* This class is intended to serve as a "test stand" for loading
* images using the Apache Imaging (nee "Sanselan") package.
* It performs a loop that loads a specified image multiple times
* recording both memory and time required for the loading process.
- *
+ *
* The notes given below explain some of the operations of this
* test class and the reasons they were designed as they are.
* This test is by no means to be considered the "last word" in how
@@ -31,61 +31,61 @@
* enhancements for some of the Apache Imaging operations. But I know
* I haven't thought of everything and am actually hoping that
* someone will have suggestions for improvements.
- *
- *
+ *
+ *
* Prerequisites to Testing --------------------------------
- *
- * Whenever testing software performance, particularly timing,
+ *
+ * Whenever testing software performance, particularly timing,
* there are a few important considerations that should be observed:
- *
- * a) Get a clean testing environment. In a modern computer
+ *
+ * a) Get a clean testing environment. In a modern computer
* system, there are dozens of processes running. To whatever
* degree possible, make sure you are not running competing
* processes that will consume computer resources and contaminate
* your timing results.
- *
+ *
* b) Make sure you are testing what you think you are testing.
* This guideline is especially true when comparing two different
* approaches. Eliminate as many variables from the analysis
* as you possible can.
- *
+ *
* c) When writing or modifying code, remember that no matter how
* obvious and self-evidentially superior a particular approach
* may seem, you don't really know if it's an improvement until you
* test it. If nothing else, the experience of computer programming
* teaches us to not to take anything for granted.
- *
+ *
* d) Make sure the JVM is allowed a sufficiently large maximum
* memory size. Putting aside the fact that the default size
* for the maximum memory use of the JVM could be too small for
* handling test images, we also want to allocate a sufficiently
* large memory size to ensure that it doesn't get too close to
* the maximum size when performing timing tests. When the JVM
- * detects that it is running up against the limits of its
+ * detects that it is running up against the limits of its
* maximum memory size setting, it triggers garbage collection
* operations that can contaminate timing values.
* I usually try to set the maximum memory size to be at least
- * twice what I think I will need. Traditionally, the memory
+ * twice what I think I will need. Traditionally, the memory
* size for the JVM is quite modest, perhaps 256 megabytes. You
* can alter that value by using something like the following
* specification (check your own JVM version for alternate values):
* -Xmx768M (maximum of 768 megabytes)
- *
- *
- *
- *
+ *
+ *
+ *
+ *
* What the Test Application Does and Why ----------------------
- *
+ *
* 0. Functions ------------------
* This class reads the path to a graphics file from the command
* line and attempts to read it several times, measuring the time
* required to read it. If you prefer, you may hardwire the code
* to use a specific file. Take whatever approach is easiest... it
* shouldn't affect the accuracy of the results.
- *
+ *
* 1) Specific Instances of Classes to Be Tested -----------------
* The Apache Imagine package includes a set of "parsers" for
- * reading different graphics file formats. The package also includes
+ * reading different graphics file formats. The package also includes
* a general-purpose class called "Imaging" that determines
* the format an arbitrarily specified input
* file and internally processes it using the appropriate parser.
@@ -93,32 +93,32 @@
* class itself, it is better to instantiate the proper subject-matter
* parser explicitly in your code. In ordinary applications, it is often
* more convenient to use the Imaging class and let it take care
- * of the details for you. But in that "taking care of details"
+ * of the details for you. But in that "taking care of details"
* operation, the Imaging class loads and instantiates a large
* number of different subject-matter parsers. These operations take
* time, consume memory, and will color the results of any timing
* and memory-use measurements you perform.
- *
+ *
* 2) Repetition -----------------------------------------
* The example output from this program included below, shows that
* it performs multiple image-loading operations, recording both
* the time required for each individual load time and the overall
* average time required for most of the load operations (times are
- * in milliseconds).
- *
+ * in milliseconds).
+ *
* image size: 10000 by 10000
* time to load image memory
* time ms avg ms used mb total mb
- * 15559.150 0.000 -- 384.845 397.035
- * 8544.926 0.000 -- 410.981 568.723
- * 8471.012 8471.012 -- 411.563 695.723
- * 8626.015 8548.513 -- 384.791 397.039
- *
- * Note that in the example output, the times for the first two load
+ * 15559.150 0.000 -- 384.845 397.035
+ * 8544.926 0.000 -- 410.981 568.723
+ * 8471.012 8471.012 -- 411.563 695.723
+ * 8626.015 8548.513 -- 384.791 397.039
+ *
+ * Note that in the example output, the times for the first two load
* operations are not included in the average. The reason for this is
* that the first time a Java application performs some operation,
* it is likely to take a little longer than for subsequent
- * operations due to the overhead for class loading and the
+ * operations due to the overhead for class loading and the
* just-in-time (JIT) compiler. Unless you're specifically interested
* in measuring the cost of start-up operations, the time they take
* will contaminate any timing values for the functions of interest.
@@ -127,23 +127,23 @@
* carry over into the second. In either case, two loop iterations
* has proven to be enough to isolate the start costs... but keep an eye
* on the individual times to make sure nothing unwanted is happening.
- *
+ *
* 3) Clean Up Memory Between Load Operations --------------------
* This test application specifically invokes the garbage collection
* method provided by the Java Runtime class. It then executes a one-second
* sleep operation.
- * Recall that in Java, the JVM performs garbage collection in a
+ * Recall that in Java, the JVM performs garbage collection in a
* separate thread that runs whenever Java thinks it important to do so.
* We want to do what we can to ensure that the garbage collection operation,
* which consumes processor resources, doesn't do so while the application
- * is loading an image. To that end, the application invokes
- * Runtime.gc() and then allows the JVM one second to initiate and
+ * is loading an image. To that end, the application invokes
+ * Runtime.gc() and then allows the JVM one second to initiate and
* complete the garbage collection. However, the .gc() method is, at best,
* a "suggestion" that the JVM should run garbage collection.
* It does not guarantee that the garbage collection will be executed and
* completed immediately. Thus the relatively long one-second delay
* between loop iterations.
- *
+ *
* ---------------------------------------------------------------------
* Good luck in using the class for testing.
* Feel free to modify it to suit your own requirements... Nothing
@@ -151,7 +151,7 @@
* well for you.
* Gary Lucas -- May 2012.
* ---------------------------------------------------------------
- *
+ *
*/
package org.apache.commons.imaging.examples;
@@ -174,7 +174,7 @@ public class ApacheImagingSpeedAndMemoryTest {
/**
* Create an instance of the speed and memory test class and execute a test
* loop for the specified file.
- *
+ *
* @param args
* the path to the file to be processed
*/
@@ -189,7 +189,7 @@ public class ApacheImagingSpeedAndMemoryTest {
/**
* Loads the input file multiple times, measuring the time and memory use
* for each iteration.
- *
+ *
* @param name
* the path for the input image file to be tested
*/
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java
----------------------------------------------------------------------
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 3472547..f0dd4f5 100644
--- a/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java
+++ b/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java
@@ -46,7 +46,7 @@ public class WriteExifMetadataExample {
/**
* This example illustrates how to add/update EXIF metadata in a JPEG file.
- *
+ *
* @param jpegImageFile
* A source image file.
* @param dst
@@ -57,10 +57,10 @@ public class WriteExifMetadataExample {
*/
public void changeExifMetadata(final File jpegImageFile, final File dst)
throws IOException, ImageReadException, ImageWriteException {
-
+
try (FileOutputStream fos = new FileOutputStream(dst);
OutputStream os = new BufferedOutputStream(fos);) {
-
+
TiffOutputSet outputSet = null;
// note that metadata might be null if no metadata is found.
@@ -133,10 +133,10 @@ public class WriteExifMetadataExample {
/**
* This example illustrates how to remove a tag (if present) from EXIF
* metadata in a JPEG file.
- *
+ *
* In this case, we remove the "aperture" tag from the EXIF metadata if
* present.
- *
+ *
* @param jpegImageFile
* A source image file.
* @param dst
@@ -209,7 +209,7 @@ public class WriteExifMetadataExample {
/**
* This example illustrates how to set the GPS values in JPEG EXIF metadata.
- *
+ *
* @param jpegImageFile
* A source image file.
* @param dst
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
index a37dff5..039ae4d 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
@@ -60,12 +60,12 @@ public class JpegReadTest extends JpegBaseTest {
// TODO only run this tests with images that have metadata...
//assertNotNull(metadata);
Debug.debug("metadata", metadata);
-
+
Debug.debug("ICC profile", Imaging.getICCProfile(imageFile, params));
final ImageInfo imageInfo = Imaging.getImageInfo(imageFile, params);
assertNotNull(imageInfo);
-
+
try {
final BufferedImage image = Imaging.getBufferedImage(imageFile, params);
assertNotNull(image);
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MicrosoftTagTest.java
----------------------------------------------------------------------
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 ea6b7dc..2814983 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
@@ -64,7 +64,7 @@ public class MicrosoftTagTest extends ExifBaseTest {
final byte[] bytes = Imaging.writeImageToBytes(image, ImageFormats.TIFF, params);
checkFields(bytes);
}
-
+
private TiffImageMetadata toTiffMetadata(final ImageMetadata metadata) throws Exception {
if (metadata instanceof JpegImageMetadata) {
return ((JpegImageMetadata)metadata).getExif();
@@ -76,7 +76,7 @@ public class MicrosoftTagTest extends ExifBaseTest {
}
private byte[] cleanImage(final File imageWithExif) throws ImageReadException, ImageWriteException, IOException {
- // Windows doesn't show XP tags if same-meaning tags exist in IPTC or XMP. Remove them:
+ // Windows doesn't show XP tags if same-meaning tags exist in IPTC or XMP. Remove them:
final ByteArrayOutputStream noXmp = new ByteArrayOutputStream();
new JpegXmpRewriter().removeXmpXml(imageWithExif, noXmp);
final ByteArrayOutputStream noXmpNoIptc = new ByteArrayOutputStream();
@@ -92,32 +92,32 @@ public class MicrosoftTagTest extends ExifBaseTest {
final ExifRewriter rewriter = new ExifRewriter();
final TiffOutputSet outputSet = metadata.getOutputSet();
final TiffOutputDirectory root = outputSet.getOrCreateRootDirectory();
-
+
// In Windows these will also hide XP fields:
root.removeField(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION);
root.removeField(TiffTagConstants.TIFF_TAG_ARTIST);
-
+
// Duplicates can be a problem:
root.removeField(MicrosoftTagConstants.EXIF_TAG_XPAUTHOR);
root.add(MicrosoftTagConstants.EXIF_TAG_XPAUTHOR, AUTHOR);
-
+
root.removeField(MicrosoftTagConstants.EXIF_TAG_XPCOMMENT);
root.add(MicrosoftTagConstants.EXIF_TAG_XPCOMMENT, COMMENT);
-
+
root.removeField(MicrosoftTagConstants.EXIF_TAG_XPSUBJECT);
root.add(MicrosoftTagConstants.EXIF_TAG_XPSUBJECT, SUBJECT);
-
+
root.removeField(MicrosoftTagConstants.EXIF_TAG_XPTITLE);
root.add(MicrosoftTagConstants.EXIF_TAG_XPTITLE, TITLE);
-
+
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
rewriter.updateExifMetadataLossy(imageWithExif, baos, outputSet);
checkFields(baos.toByteArray());
}
-
+
private void checkFields(final byte[] file) throws Exception {
final TiffImageMetadata metadata = toTiffMetadata(Imaging.getMetadata(file));
-
+
// field values may be duplicated between directories, we have to check all
final List<Object> authorValues = new ArrayList<>();
final List<Object> commentValues = new ArrayList<>();
@@ -129,7 +129,7 @@ public class MicrosoftTagTest extends ExifBaseTest {
commentValues.add(d.getFieldValue(MicrosoftTagConstants.EXIF_TAG_XPCOMMENT, false));
subjectValues.add(d.getFieldValue(MicrosoftTagConstants.EXIF_TAG_XPSUBJECT, false));
}
-
+
assertTrue(authorValues.contains(AUTHOR));
assertTrue(commentValues.contains(COMMENT));
assertTrue(subjectValues.contains(SUBJECT));
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
----------------------------------------------------------------------
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 863435a..adb40b4 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
@@ -71,10 +71,10 @@ public class IptcUpdateTest extends IptcBaseTest {
assertNotNull(metadata);
final File noIptcFile = removeIptc(byteSource);
-
+
final JpegPhotoshopMetadata outMetadata = new JpegImageParser().getPhotoshopMetadata(
new ByteSourceFile(noIptcFile), params);
-
+
// FIXME should either be null or empty
assertTrue(outMetadata == null
|| outMetadata.getItems().size() == 0);
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java
index 4e9d499..88c6a4d 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngReadTest.java
@@ -68,7 +68,7 @@ public class PngReadTest extends PngBaseTest {
assertNotNull(imageInfo);
Debug.debug("ICC profile", Imaging.getICCProfile(imageFile));
-
+
final BufferedImage image = Imaging.getBufferedImage(imageFile);
assertNotNull(image);
}
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/pnm/PbmFileInfoTest.java
----------------------------------------------------------------------
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 f69dea3..8963eaf 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
@@ -34,7 +34,7 @@ public class PbmFileInfoTest{
InputStream inputStream = new ByteArrayInputStream(byteArray);
inputStream.read(byteArray);
- try {
+ try {
pbmFileInfo.getRGB(inputStream);
fail("Expecting exception: IOException");
} catch(IOException e) {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java
index 10dc599..a8e7088 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java
@@ -301,7 +301,7 @@ public class TiffCcittTest extends TiffBaseTest {
* Generates the next combination of elements in the sequence array, with
* each element having a maximum value of max. Initially, the sequence
* should be set to minimum values of each element.
- *
+ *
* @param sequence
* the array of elements to update
* @param max
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
index 8f69a5f..f395a2b 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
@@ -50,7 +50,7 @@ public class TiffReadWriteTagsTest extends TiffBaseTest {
final String area = "A good area";
final float widthRes = 2.2f;
final double geoDoubleParams = -8.4;
-
+
final TiffOutputSet set = new TiffOutputSet();
final TiffOutputDirectory dir = set.getOrCreateRootDirectory();
dir.add(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION, description);
@@ -62,11 +62,11 @@ public class TiffReadWriteTagsTest extends TiffBaseTest {
dir.add(GpsTagConstants.GPS_TAG_GPS_AREA_INFORMATION, area);
dir.add(MicrosoftHdPhotoTagConstants.EXIF_TAG_WIDTH_RESOLUTION, widthRes);
dir.add(GeoTiffTagConstants.EXIF_TAG_GEO_DOUBLE_PARAMS_TAG, geoDoubleParams);
-
+
final TiffImageWriterLossy writer = new TiffImageWriterLossy();
final ByteArrayOutputStream tiff = new ByteArrayOutputStream();
writer.write(tiff, set);
-
+
final TiffReader reader = new TiffReader(true);
final Map<String, Object> params = new TreeMap<>();
final FormatCompliance formatCompliance = new FormatCompliance("");
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
index 6aad65d..ec6537e 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
@@ -36,7 +36,7 @@ public class TiffSubImageTest extends TiffBaseTest {
public void testSubImage() throws ImageReadException, ImageWriteException, IOException {
final BufferedImage src = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
final byte[] imageBytes = Imaging.writeImageToBytes(src, ImageFormats.TIFF, null);
-
+
final Map<String, Object> params = new TreeMap<>();
params.put(TiffConstants.PARAM_KEY_SUBIMAGE_X, 0);
params.put(TiffConstants.PARAM_KEY_SUBIMAGE_Y, 0);
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeTest.java
index bfe732b..762a185 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeTest.java
@@ -25,7 +25,7 @@ public class FieldTypeTest{
@Test
public void testGetFieldTypeWithNegative() {
- try {
+ try {
FieldType.getFieldType((-748));
fail("Expecting exception: Exception");
} catch(Exception e) {
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpBaseTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpBaseTest.java b/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpBaseTest.java
index 32ff33c..15450bd 100644
--- a/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpBaseTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpBaseTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpReadTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpReadTest.java b/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpReadTest.java
index 564a377..6b956ab 100644
--- a/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/wbmp/WbmpReadTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/xbm/XbmBaseTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/xbm/XbmBaseTest.java b/src/test/java/org/apache/commons/imaging/formats/xbm/XbmBaseTest.java
index 9dde918..d42b67c 100644
--- a/src/test/java/org/apache/commons/imaging/formats/xbm/XbmBaseTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/xbm/XbmBaseTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/xbm/XbmReadTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/xbm/XbmReadTest.java b/src/test/java/org/apache/commons/imaging/formats/xbm/XbmReadTest.java
index dcdd4a5..0365c4b 100644
--- a/src/test/java/org/apache/commons/imaging/formats/xbm/XbmReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/xbm/XbmReadTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/xpm/XpmBaseTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/xpm/XpmBaseTest.java b/src/test/java/org/apache/commons/imaging/formats/xpm/XpmBaseTest.java
index 7fae8f2..d6946ac 100644
--- a/src/test/java/org/apache/commons/imaging/formats/xpm/XpmBaseTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/xpm/XpmBaseTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/formats/xpm/XpmReadTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/formats/xpm/XpmReadTest.java b/src/test/java/org/apache/commons/imaging/formats/xpm/XpmReadTest.java
index 2f113fa..d6248c2 100644
--- a/src/test/java/org/apache/commons/imaging/formats/xpm/XpmReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/xpm/XpmReadTest.java
@@ -2,9 +2,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java b/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
index 994c108..dbf8c27 100644
--- a/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
+++ b/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
@@ -35,7 +35,7 @@ public class PaletteQuantizationTest extends ImagingTest {
}
}
checkPaletteDetails(whiteImage, 10, 1);
-
+
final BufferedImage whiteAndBlackImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
for (int y = 0; y < whiteImage.getHeight(); y++) {
for (int x = 0; x < 5; x++) {
@@ -46,7 +46,7 @@ public class PaletteQuantizationTest extends ImagingTest {
}
}
checkPaletteDetails(whiteAndBlackImage, 10, 2);
-
+
final BufferedImage rainbowImage = new BufferedImage(9, 10, BufferedImage.TYPE_INT_RGB);
for (int y = 0; y < whiteImage.getHeight(); y++) {
for (int x = 0; x < 3; x++) {
@@ -62,7 +62,7 @@ public class PaletteQuantizationTest extends ImagingTest {
checkPaletteDetails(rainbowImage, 10, 3);
checkPaletteDetails(rainbowImage, 2, 2);
}
-
+
private void checkPaletteDetails(final BufferedImage image, final int limit, final int expectedSize) throws ImageWriteException {
final PaletteFactory paletteFactory = new PaletteFactory();
Palette palette;
@@ -85,14 +85,14 @@ public class PaletteQuantizationTest extends ImagingTest {
if (exact) {
checkPixelsAreIdentical(image, palette);
}
-
+
palette = paletteFactory.makeQuantizedRgbPalette(image, limit);
assertEquals(expectedSize, palette.length());
//checkUniqueColors(image, palette);
if (exact) {
//checkDithering(image, palette);
}
-
+
final MedianCutQuantizer medianCutQuantizer = new MedianCutQuantizer(true);
palette = medianCutQuantizer.process(
image, limit, new MostPopulatedBoxesMedianCut());
@@ -102,7 +102,7 @@ public class PaletteQuantizationTest extends ImagingTest {
checkPixelsAreIdentical(image, palette);
}
}
-
+
private void checkUniqueColors(final BufferedImage src, final Palette palette) throws ImageWriteException {
final BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
dst.getGraphics().drawImage(src, 0, 0, src.getWidth(), src.getHeight(), null);
@@ -110,7 +110,7 @@ public class PaletteQuantizationTest extends ImagingTest {
final Palette ditheredPalette = new PaletteFactory().makeExactRgbPaletteSimple(dst, palette.length() * 2);
assertEquals(palette.length(), ditheredPalette.length());
}
-
+
private void checkPixelsAreIdentical(final BufferedImage src, final Palette palette) throws ImageWriteException {
final BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
dst.getGraphics().drawImage(src, 0, 0, src.getWidth(), src.getHeight(), null);
http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/f108400a/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java b/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
index 6ea7829..f6f9c30 100644
--- a/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
+++ b/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
@@ -31,7 +31,7 @@ final class ImageAsserts {
private ImageAsserts() {
}
-
+
static void assertEquals(final BufferedImage a, final BufferedImage b) {
assertEquals(a, b, 0);
}