]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2183: Use event producer when Colour Profile in PNG Image is bad; patch submitted...
authorLuis Bernardo <lbernardo@apache.org>
Thu, 21 Feb 2013 00:45:28 +0000 (00:45 +0000)
committerLuis Bernardo <lbernardo@apache.org>
Thu, 21 Feb 2013 00:45:28 +0000 (00:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1448483 13f79535-47bb-0310-9956-ffa450edef68

lib/xmlgraphics-commons-svn-trunk.jar
src/java/org/apache/fop/ResourceEventProducer.java
src/java/org/apache/fop/ResourceEventProducer.xml
src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java

index 91648b9fff9cd834021c7aab3fd61d19ea4c2ed4..453ba2e66f48d3483da5020bc6f54fdcefc771ae 100644 (file)
Binary files a/lib/xmlgraphics-commons-svn-trunk.jar and b/lib/xmlgraphics-commons-svn-trunk.jar differ
index 926b7c92b8cd7420e0d36326ba5a5f06562d458e..18293ff06a9773bbd8bda3807070da8eadf46542 100644 (file)
@@ -152,4 +152,12 @@ public interface ResourceEventProducer extends EventProducer {
      * @event.severity ERROR
      */
     void catalogResolverNotCreated(Object source, String message);
+
+    /**
+     * Warning in an image.
+     * @param source the event source
+     * @param message warning
+     * @event.severity WARN
+     */
+    void imageWarning(Object source, String message);
 }
index 0ea34af2c113cd460df7a77f034e040389914e2f..d9b337daef5e6a91fdc3c79c95c68e020d572219 100644 (file)
@@ -20,6 +20,7 @@
   <message key="locator">[ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]</message>
   <message key="imageNotFound">Image not found.[ URI: {uri}.]{{locator}}</message>
   <message key="imageError">Image not available.[ URI: {uri}.] Reason:[ {reason}][ {e}]{{locator}}</message>
+  <message key="imageWarning">Image warning.[ URI: {uri}.] Reason:[ {message}][ {e}]{{locator}}</message>
   <message key="imageIOError">I/O error while loading image.[ URI: {uri}.][ Reason: {ioe}]{{locator}}</message>
   <message key="ifoNoIntrinsicSize">The intrinsic dimensions of an instream-foreign-object could not be determined.{{locator}}</message>
   <message key="uriError">Error while handling URI: {uri}. Reason: {e}{{locator}}</message>
index 2205aea4c2435f50b6688d17ddd98da940f882f1..12dd46c2083b4f8cf9808c7f43862f78445c8561 100644 (file)
@@ -155,10 +155,17 @@ public abstract class AbstractIFPainter<T extends IFDocumentHandler> implements
         context.putHints(hints);
 
         ImageFlavor[] flavors = imageHandlerRegistry.getSupportedFlavors(context);
+        info.getCustomObjects().put("warningincustomobject", true);
         org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                     info, flavors,
                     hints, sessionContext);
 
+        if (info.getCustomObjects().get("warning") != null) {
+            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+                    getUserAgent().getEventBroadcaster());
+            eventProducer.imageWarning(this, (String)info.getCustomObjects().get("warning"));
+        }
+
         try {
             drawImage(img, rect, context);
         } catch (IOException ioe) {