You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/03/28 22:28:24 UTC

svn commit: r523452 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/image/JpegImage.java

Author: jeremias
Date: Wed Mar 28 13:28:23 2007
New Revision: 523452

URL: http://svn.apache.org/viewvc?view=rev&rev=523452
Log:
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.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/image/JpegImage.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/image/JpegImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/image/JpegImage.java?view=diff&rev=523452&r1=523451&r2=523452
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/image/JpegImage.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/image/JpegImage.java Wed Mar 28 13:28:23 2007
@@ -189,15 +189,20 @@
             }
             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;



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org