From 1fa4ee25a8374a405c458767c4d93b547976b6da Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 9 Nov 2007 13:17:29 +0000 Subject: [PATCH] Merge from Trunk revision 523452 (Hotfix for 0.93): 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/branches/fop-0_93@593520 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/image/JpegImage.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/image/JpegImage.java b/src/java/org/apache/fop/image/JpegImage.java index 60d5347c8..d67816cff 100644 --- a/src/java/org/apache/fop/image/JpegImage.java +++ b/src/java/org/apache/fop/image/JpegImage.java @@ -188,9 +188,10 @@ 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() + ")"); } if (iccProfile.getNumComponents() != this.colorSpace.getNumComponents()) { log.warn("The number of components of the ICC profile (" @@ -205,6 +206,10 @@ public class JpegImage extends AbstractFopImage { 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; -- 2.39.5