mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
#655 Experimental force raster conversion switch.
(cherry picked from commit 7e0d8922dafc0f02417ca02f597eb9ce675816dd)
This commit is contained in:
parent
975e23c28f
commit
3d5cf0eecd
@ -104,6 +104,7 @@ public final class JPEGImageReader extends ImageReaderBase {
|
|||||||
// TODO: As we already parse the SOF segments, maybe we should stop delegating getWidth/getHeight etc?
|
// TODO: As we already parse the SOF segments, maybe we should stop delegating getWidth/getHeight etc?
|
||||||
|
|
||||||
final static boolean DEBUG = "true".equalsIgnoreCase(System.getProperty("com.twelvemonkeys.imageio.plugins.jpeg.debug"));
|
final static boolean DEBUG = "true".equalsIgnoreCase(System.getProperty("com.twelvemonkeys.imageio.plugins.jpeg.debug"));
|
||||||
|
final static boolean FORCE_RASTER_CONVERSION = "force".equalsIgnoreCase(System.getProperty("com.twelvemonkeys.imageio.plugins.jpeg.raster"));
|
||||||
|
|
||||||
/** Internal constant for referring all APP segments */
|
/** Internal constant for referring all APP segments */
|
||||||
static final int ALL_APP_MARKERS = -1;
|
static final int ALL_APP_MARKERS = -1;
|
||||||
@ -335,7 +336,7 @@ public final class JPEGImageReader extends ImageReaderBase {
|
|||||||
|
|
||||||
// We need to apply ICC profile unless the profile is sRGB/default gray (whatever that is)
|
// We need to apply ICC profile unless the profile is sRGB/default gray (whatever that is)
|
||||||
// - or only filter out the bad ICC profiles in the JPEGSegmentImageInputStream.
|
// - or only filter out the bad ICC profiles in the JPEGSegmentImageInputStream.
|
||||||
else if (bogusAdobeDCT
|
else if (FORCE_RASTER_CONVERSION || bogusAdobeDCT
|
||||||
|| profile != null && !ColorProfiles.isCS_sRGB(profile)
|
|| profile != null && !ColorProfiles.isCS_sRGB(profile)
|
||||||
|| (long) sof.lines * sof.samplesPerLine > Integer.MAX_VALUE
|
|| (long) sof.lines * sof.samplesPerLine > Integer.MAX_VALUE
|
||||||
|| delegateCSTypeMismatch(jfif, adobeDCT, sof, sourceCSType)) {
|
|| delegateCSTypeMismatch(jfif, adobeDCT, sof, sourceCSType)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user