mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 12:05:29 -04:00
#182 Code clean up.
This commit is contained in:
parent
7ac1589186
commit
51afe2d2e8
@ -70,7 +70,7 @@ final class AdobeDCT extends Application {
|
|||||||
public static AdobeDCT read(final DataInput data, final int length) throws IOException {
|
public static AdobeDCT read(final DataInput data, final int length) throws IOException {
|
||||||
// TODO: Investigate http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6355567: 33/35 byte Adobe APP14 markers
|
// TODO: Investigate http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6355567: 33/35 byte Adobe APP14 markers
|
||||||
|
|
||||||
data.skipBytes(6);
|
data.skipBytes(6); // A, d, o, b, e, \0
|
||||||
|
|
||||||
// version (byte), flags (4bytes), color transform (byte: 0=unknown, 1=YCC, 2=YCCK)
|
// version (byte), flags (4bytes), color transform (byte: 0=unknown, 1=YCC, 2=YCCK)
|
||||||
return new AdobeDCT(
|
return new AdobeDCT(
|
||||||
|
@ -62,7 +62,7 @@ final class EXIFThumbnailReader extends ThumbnailReader {
|
|||||||
|
|
||||||
private transient SoftReference<BufferedImage> cachedThumbnail;
|
private transient SoftReference<BufferedImage> cachedThumbnail;
|
||||||
|
|
||||||
public EXIFThumbnailReader(ThumbnailReadProgressListener progressListener, ImageReader jpegReader, int imageIndex, int thumbnailIndex, Directory ifd, ImageInputStream stream) {
|
EXIFThumbnailReader(final ThumbnailReadProgressListener progressListener, final ImageReader jpegReader, final int imageIndex, final int thumbnailIndex, final Directory ifd, final ImageInputStream stream) {
|
||||||
super(progressListener, imageIndex, thumbnailIndex);
|
super(progressListener, imageIndex, thumbnailIndex);
|
||||||
this.reader = Validate.notNull(jpegReader);
|
this.reader = Validate.notNull(jpegReader);
|
||||||
this.ifd = ifd;
|
this.ifd = ifd;
|
||||||
@ -96,7 +96,7 @@ final class EXIFThumbnailReader extends ThumbnailReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BufferedImage readJPEGCached(boolean pixelsExposed) throws IOException {
|
private BufferedImage readJPEGCached(final boolean pixelsExposed) throws IOException {
|
||||||
BufferedImage thumbnail = cachedThumbnail != null ? cachedThumbnail.get() : null;
|
BufferedImage thumbnail = cachedThumbnail != null ? cachedThumbnail.get() : null;
|
||||||
|
|
||||||
if (thumbnail == null) {
|
if (thumbnail == null) {
|
||||||
|
@ -114,16 +114,6 @@ final class JFIF extends Application {
|
|||||||
getBytes(buffer, x * y * 3),
|
getBytes(buffer, x * y * 3),
|
||||||
bytes
|
bytes
|
||||||
);
|
);
|
||||||
// return new JFIF(
|
|
||||||
// data.readUnsignedByte(),
|
|
||||||
// data.readUnsignedByte(),
|
|
||||||
// data.readUnsignedByte(),
|
|
||||||
// data.readUnsignedShort(),
|
|
||||||
// data.readUnsignedShort(),
|
|
||||||
// x = data.readUnsignedByte(),
|
|
||||||
// y = data.readUnsignedByte(),
|
|
||||||
// JPEGImageReader.readFully(data, x * y * 3)
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] getBytes(ByteBuffer buffer, int len) {
|
private static byte[] getBytes(ByteBuffer buffer, int len) {
|
||||||
|
@ -41,7 +41,7 @@ import java.io.IOException;
|
|||||||
final class JFIFThumbnailReader extends ThumbnailReader {
|
final class JFIFThumbnailReader extends ThumbnailReader {
|
||||||
private final JFIF segment;
|
private final JFIF segment;
|
||||||
|
|
||||||
public JFIFThumbnailReader(ThumbnailReadProgressListener progressListener, int imageIndex, int thumbnailIndex, JFIF segment) {
|
JFIFThumbnailReader(final ThumbnailReadProgressListener progressListener, final int imageIndex, final int thumbnailIndex, final JFIF segment) {
|
||||||
super(progressListener, imageIndex, thumbnailIndex);
|
super(progressListener, imageIndex, thumbnailIndex);
|
||||||
this.segment = segment;
|
this.segment = segment;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ final class JFXXThumbnailReader extends ThumbnailReader {
|
|||||||
|
|
||||||
private transient SoftReference<BufferedImage> cachedThumbnail;
|
private transient SoftReference<BufferedImage> cachedThumbnail;
|
||||||
|
|
||||||
protected JFXXThumbnailReader(final ThumbnailReadProgressListener progressListener, ImageReader jpegReader, final int imageIndex, final int thumbnailIndex, final JFXX segment) {
|
JFXXThumbnailReader(final ThumbnailReadProgressListener progressListener, final ImageReader jpegReader, final int imageIndex, final int thumbnailIndex, final JFXX segment) {
|
||||||
super(progressListener, imageIndex, thumbnailIndex);
|
super(progressListener, imageIndex, thumbnailIndex);
|
||||||
this.reader = Validate.notNull(jpegReader);
|
this.reader = Validate.notNull(jpegReader);
|
||||||
this.segment = segment;
|
this.segment = segment;
|
||||||
@ -85,7 +85,7 @@ final class JFXXThumbnailReader extends ThumbnailReader {
|
|||||||
return thumbnail;
|
return thumbnail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIOMetadata readMetadata() throws IOException {
|
IIOMetadata readMetadata() throws IOException {
|
||||||
ImageInputStream input = new ByteArrayImageInputStream(segment.thumbnail);
|
ImageInputStream input = new ByteArrayImageInputStream(segment.thumbnail);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user