mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-03 03:25:28 -04:00
#837: Now uses last app segment for color space detection.
This commit is contained in:
parent
57680f1bec
commit
2c7c47b158
@ -888,20 +888,21 @@ public final class JPEGImageReader extends ImageReaderBase {
|
||||
throw new IIOException("No SOF segment in stream");
|
||||
}
|
||||
|
||||
private Application lastAppSegment(int marker, String identifier) throws IOException {
|
||||
List<Application> appSegments = getAppSegments(marker, identifier);
|
||||
return appSegments.isEmpty() ? null : appSegments.get(appSegments.size() - 1);
|
||||
}
|
||||
|
||||
AdobeDCT getAdobeDCT() throws IOException {
|
||||
List<Application> adobe = getAppSegments(JPEG.APP14, "Adobe");
|
||||
return adobe.isEmpty() ? null : (AdobeDCT) adobe.get(0);
|
||||
return (AdobeDCT) lastAppSegment(JPEG.APP14, "Adobe");
|
||||
}
|
||||
|
||||
JFIF getJFIF() throws IOException{
|
||||
List<Application> jfif = getAppSegments(JPEG.APP0, "JFIF");
|
||||
return jfif.isEmpty() ? null : (JFIF) jfif.get(0);
|
||||
|
||||
return (JFIF) lastAppSegment(JPEG.APP0, "JFIF");
|
||||
}
|
||||
|
||||
JFXX getJFXX() throws IOException {
|
||||
List<Application> jfxx = getAppSegments(JPEG.APP0, "JFXX");
|
||||
return jfxx.isEmpty() ? null : (JFXX) jfxx.get(0);
|
||||
return (JFXX) lastAppSegment(JPEG.APP0, "JFXX");
|
||||
}
|
||||
|
||||
private EXIF getExif() throws IOException {
|
||||
|
@ -52,7 +52,7 @@ import static com.twelvemonkeys.imageio.util.IIOUtil.lookupProviderByName;
|
||||
* @version $Id: JPEGImageReaderSpi.java,v 1.0 24.01.11 22.12 haraldk Exp$
|
||||
*/
|
||||
public final class JPEGImageReaderSpi extends ImageReaderSpiBase {
|
||||
protected ImageReaderSpi delegateProvider;
|
||||
ImageReaderSpi delegateProvider;
|
||||
|
||||
/**
|
||||
* Constructor for use by {@link javax.imageio.spi.IIORegistry} only.
|
||||
|
Loading…
x
Reference in New Issue
Block a user