mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 12:35:29 -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");
|
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 {
|
AdobeDCT getAdobeDCT() throws IOException {
|
||||||
List<Application> adobe = getAppSegments(JPEG.APP14, "Adobe");
|
return (AdobeDCT) lastAppSegment(JPEG.APP14, "Adobe");
|
||||||
return adobe.isEmpty() ? null : (AdobeDCT) adobe.get(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JFIF getJFIF() throws IOException{
|
JFIF getJFIF() throws IOException{
|
||||||
List<Application> jfif = getAppSegments(JPEG.APP0, "JFIF");
|
return (JFIF) lastAppSegment(JPEG.APP0, "JFIF");
|
||||||
return jfif.isEmpty() ? null : (JFIF) jfif.get(0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JFXX getJFXX() throws IOException {
|
JFXX getJFXX() throws IOException {
|
||||||
List<Application> jfxx = getAppSegments(JPEG.APP0, "JFXX");
|
return (JFXX) lastAppSegment(JPEG.APP0, "JFXX");
|
||||||
return jfxx.isEmpty() ? null : (JFXX) jfxx.get(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private EXIF getExif() throws IOException {
|
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$
|
* @version $Id: JPEGImageReaderSpi.java,v 1.0 24.01.11 22.12 haraldk Exp$
|
||||||
*/
|
*/
|
||||||
public final class JPEGImageReaderSpi extends ImageReaderSpiBase {
|
public final class JPEGImageReaderSpi extends ImageReaderSpiBase {
|
||||||
protected ImageReaderSpi delegateProvider;
|
ImageReaderSpi delegateProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for use by {@link javax.imageio.spi.IIORegistry} only.
|
* Constructor for use by {@link javax.imageio.spi.IIORegistry} only.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user