You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by je...@apache.org on 2010/08/18 10:19:32 UTC

svn commit: r986590 - /xmlgraphics/batik/branches/svgcolor12/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java

Author: jeremias
Date: Wed Aug 18 08:19:32 2010
New Revision: 986590

URL: http://svn.apache.org/viewvc?rev=986590&view=rev
Log:
When the color-profile is unavailable, continue without it and rely on sRGB. Don't throw an exception in that case but display it to the user and continue.

Modified:
    xmlgraphics/batik/branches/svgcolor12/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java

Modified: xmlgraphics/batik/branches/svgcolor12/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/svgcolor12/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java?rev=986590&r1=986589&r2=986590&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svgcolor12/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java (original)
+++ xmlgraphics/batik/branches/svgcolor12/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java Wed Aug 18 08:19:32 2010
@@ -108,19 +108,27 @@ public class SVGColorProfileElementBridg
             }
 
             ParsedURL purl = new ParsedURL(pDocURL, href);
-            if (!purl.complete())
-                throw new BridgeException(ctx, paintedElement, ERR_URI_MALFORMED,
-                                          new Object[] {href});
+            if (!purl.complete()) {
+                BridgeException be = new BridgeException(ctx, paintedElement, ERR_URI_MALFORMED,
+                        new Object[] {href});
+                ctx.getUserAgent().displayError(be);
+                return null; //Don't throw. Continue without the profile
+            }
             try {
                 ctx.getUserAgent().checkLoadExternalResource(purl, pDocURL);
                 p = ICC_Profile.getInstance(purl.openStream());
             } catch (IOException ioEx) {
-                throw new BridgeException(ctx, paintedElement, ioEx, ERR_URI_IO,
+                BridgeException be = new BridgeException(ctx, paintedElement, ioEx, ERR_URI_IO,
                                           new Object[] {href});
+                ctx.getUserAgent().displayError(be);
+                return null; //Don't throw. Continue without the profile
                 // ??? IS THAT AN ERROR FOR THE SVG SPEC ???
             } catch (SecurityException secEx) {
-                throw new BridgeException(ctx, paintedElement, secEx, ERR_URI_UNSECURE,
-                                          new Object[] {href});
+                BridgeException be = new BridgeException(ctx, paintedElement, secEx,
+                        ERR_URI_UNSECURE,
+                        new Object[] {href});
+                ctx.getUserAgent().displayError(be);
+                return null; //Don't throw. Continue without the profile
             }
         }
         if (p == null) {