]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
fix for invalid colorspace on jpeg
authorKeiron Liddle <keiron@apache.org>
Tue, 20 Aug 2002 06:52:37 +0000 (06:52 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 20 Aug 2002 06:52:37 +0000 (06:52 +0000)
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
src/org/apache/fop/image/JpegImage.java

index 44c3335d54d0ac7e75cad7eab72eb026c19d046a..11bb15c49f5cb879c257075e3331294413c9636e 100644 (file)
@@ -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;
index ee71a86ff305f0f7f295e64640a1b5ba48a1158d..880de6aa237829e5a7c5c5bbd1f04a329dd8e77d 100644 (file)
@@ -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;
     }