diff options
author | Luis Bernardo <lbernardo@apache.org> | 2013-02-21 00:45:28 +0000 |
---|---|---|
committer | Luis Bernardo <lbernardo@apache.org> | 2013-02-21 00:45:28 +0000 |
commit | d0d7e25d98cd1509e8433782af336e93bb02f1b8 (patch) | |
tree | 2d16132a894d9030e83d0c4c48bde02f33c4e924 | |
parent | b7a4ebbacb471c61974fdb39e9c1c02d245603f5 (diff) | |
download | xmlgraphics-fop-d0d7e25d98cd1509e8433782af336e93bb02f1b8.tar.gz xmlgraphics-fop-d0d7e25d98cd1509e8433782af336e93bb02f1b8.zip |
FOP-2183: Use event producer when Colour Profile in PNG Image is bad; patch submitted by Simon Steiner
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1448483 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | lib/xmlgraphics-commons-svn-trunk.jar | bin | 628756 -> 628816 bytes | |||
-rw-r--r-- | src/java/org/apache/fop/ResourceEventProducer.java | 8 | ||||
-rw-r--r-- | src/java/org/apache/fop/ResourceEventProducer.xml | 1 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java | 7 |
4 files changed, 16 insertions, 0 deletions
diff --git a/lib/xmlgraphics-commons-svn-trunk.jar b/lib/xmlgraphics-commons-svn-trunk.jar Binary files differindex 91648b9ff..453ba2e66 100644 --- a/lib/xmlgraphics-commons-svn-trunk.jar +++ b/lib/xmlgraphics-commons-svn-trunk.jar diff --git a/src/java/org/apache/fop/ResourceEventProducer.java b/src/java/org/apache/fop/ResourceEventProducer.java index 926b7c92b..18293ff06 100644 --- a/src/java/org/apache/fop/ResourceEventProducer.java +++ b/src/java/org/apache/fop/ResourceEventProducer.java @@ -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); } diff --git a/src/java/org/apache/fop/ResourceEventProducer.xml b/src/java/org/apache/fop/ResourceEventProducer.xml index 0ea34af2c..d9b337dae 100644 --- a/src/java/org/apache/fop/ResourceEventProducer.xml +++ b/src/java/org/apache/fop/ResourceEventProducer.xml @@ -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> diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java index 2205aea4c..12dd46c20 100644 --- a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java +++ b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java @@ -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) { |