From 7e66c852838e0e01dc08b6703cf3e62ef6f177f8 Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Tue, 20 Aug 2002 06:52:37 +0000 Subject: [PATCH] fix for invalid colorspace on jpeg also catches error when jimi not in classpath git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195107 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/image/JimiImage.java | 2 +- src/org/apache/fop/image/JpegImage.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/org/apache/fop/image/JimiImage.java b/src/org/apache/fop/image/JimiImage.java index 44c3335d5..11bb15c49 100644 --- a/src/org/apache/fop/image/JimiImage.java +++ b/src/org/apache/fop/image/JimiImage.java @@ -136,7 +136,7 @@ public class JimiImage extends AbstractFopImage { } else { this.m_isTransparent = false; } - } catch (Exception ex) { + } catch (Throwable ex) { log.error("Error while loading image " + this.m_href.toString(), ex); return; diff --git a/src/org/apache/fop/image/JpegImage.java b/src/org/apache/fop/image/JpegImage.java index ee71a86ff..880de6aa2 100644 --- a/src/org/apache/fop/image/JpegImage.java +++ b/src/org/apache/fop/image/JpegImage.java @@ -94,6 +94,10 @@ public class JpegImage extends AbstractFopImage { // howto create CMYK color space this.m_colorSpace = ColorSpace.getInstance( ColorSpace.CS_CIEXYZ); + } else { + ua.getLogger().error("Unknown ColorSpace for image: " + + this.m_href.toString()); + return false; } found_dimensions = true; @@ -153,6 +157,10 @@ public class JpegImage extends AbstractFopImage { return false; } iccProfile = ICC_Profile.getInstance(iccStream.toByteArray()); + } else if(this.m_colorSpace == null) { + ua.getLogger().error("ColorSpace not specified for image: " + + this.m_href.toString()); + return false; } return true; } -- 2.39.5