mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 03:55:28 -04:00
General clean-up
This commit is contained in:
parent
db782cfe9e
commit
3b34d6e7ce
@ -346,7 +346,7 @@ public final class FileUtil {
|
||||
|
||||
/**
|
||||
* Gets the file (type) extension of the given file.
|
||||
* A file extension is the part of the filename, after the last occurence
|
||||
* A file extension is the part of the filename, after the last occurrence
|
||||
* of a period {@code '.'}.
|
||||
* If the filename contains no period, {@code null} is returned.
|
||||
*
|
||||
|
@ -1631,12 +1631,14 @@ public abstract class ImageReaderAbstractTest<T extends ImageReader> {
|
||||
BufferedImage one = reader.read(0);
|
||||
BufferedImage two = reader.read(0);
|
||||
|
||||
// Test for same BufferedImage instance
|
||||
assertNotSame("Multiple reads return same (mutable) image", one, two);
|
||||
|
||||
one.setRGB(0, 0, Color.BLUE.getRGB());
|
||||
two.setRGB(0, 0, Color.RED.getRGB());
|
||||
|
||||
// Test for same backing storage (array)
|
||||
one.setRGB(0, 0, Color.BLACK.getRGB());
|
||||
two.setRGB(0, 0, Color.WHITE.getRGB());
|
||||
assertTrue(one.getRGB(0, 0) != two.getRGB(0, 0));
|
||||
|
||||
reader.dispose();
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,6 @@ final class JPEGSegmentImageInputStream extends ImageInputStreamImpl {
|
||||
else {
|
||||
if (marker == JPEG.EOI) {
|
||||
segment = new Segment(marker, realPosition, segment.end(), 2);
|
||||
segments.add(segment);
|
||||
}
|
||||
else {
|
||||
// Length including length field itself
|
||||
@ -165,6 +164,7 @@ final class JPEGSegmentImageInputStream extends ImageInputStreamImpl {
|
||||
// Inspect segment, see if we have 16 bit precision (assuming segments will not contain
|
||||
// multiple quality tables with varying precision)
|
||||
int qtInfo = stream.read();
|
||||
|
||||
if ((qtInfo & 0x10) == 0x10) {
|
||||
processWarningOccured("16 bit DQT encountered");
|
||||
segment = new DownsampledDQTReplacement(realPosition, segment.end(), length, qtInfo, stream);
|
||||
@ -188,10 +188,9 @@ final class JPEGSegmentImageInputStream extends ImageInputStreamImpl {
|
||||
else {
|
||||
segment = new Segment(marker, realPosition, segment.end(), length);
|
||||
}
|
||||
|
||||
segments.add(segment);
|
||||
}
|
||||
|
||||
segments.add(segment);
|
||||
currentSegment = segments.size() - 1;
|
||||
|
||||
if (marker == JPEG.SOS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user