From: Jeremias Maerki Date: Wed, 28 Mar 2007 20:28:23 +0000 (+0000) Subject: Don't log a stacktrace when a JPEG is encountered that has a bad ICC profile and... X-Git-Tag: fop-0_94~166 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=da038e00dca8d366b7e005915920a321a7a856cb;p=xmlgraphics-fop.git Don't log a stacktrace when a JPEG is encountered that has a bad ICC profile and give a nicer warning message. Log the event when a CMYK JPEG with an APPE marker is encountered. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@523452 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/image/JpegImage.java b/src/java/org/apache/fop/image/JpegImage.java index 820a728f9..3ad745281 100644 --- a/src/java/org/apache/fop/image/JpegImage.java +++ b/src/java/org/apache/fop/image/JpegImage.java @@ -189,15 +189,20 @@ public class JpegImage extends AbstractFopImage { } try { iccProfile = ICC_Profile.getInstance(iccStream.toByteArray()); - } catch (Exception e) { - log.error("Invalid ICC profile: " + e, e); - return false; + } catch (IllegalArgumentException iae) { + log.warn("An ICC profile is present but it is invalid (" + + iae.getMessage() + "). The color profile will be ignored. (" + + this.getOriginalURI() + ")"); } } else if (this.colorSpace == null) { log.error("ColorSpace not specified for JPEG image"); return false; } if (hasAPPEMarker && this.colorSpace.getType() == ColorSpace.TYPE_CMYK) { + if (log.isDebugEnabled()) { + log.debug("JPEG has an Adobe APPE marker. Note: CMYK Image will be inverted. (" + + this.getOriginalURI() + ")"); + } this.invertImage = true; } return true;