Index: src/java/org/apache/fop/image/BatikImage.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/image/BatikImage.java,v
retrieving revision 1.1
diff -w -u -r1.1 BatikImage.java
--- src/java/org/apache/fop/image/BatikImage.java	11 Oct 2004 21:43:13 -0000	1.1
+++ src/java/org/apache/fop/image/BatikImage.java	13 Oct 2004 01:45:32 -0000
@@ -118,14 +118,15 @@
 
             this.height = cr.getHeight();
             this.width  = cr.getWidth();
-
-            cr = new Any2sRGBRed(cr);
-
             this.isTransparent = false;
             this.softMask = null;
+            this.bitmapsSize = this.width * this.height * 3;
+            this.bitmaps = new byte[this.bitmapsSize];
+            this.bitsPerPixel = 8;
+
             int transparencyType = cm.getTransparency();
-            if ((transparencyType == Transparency.BITMASK) 
-                    && (cm instanceof IndexColorModel)) {
+            if (cm instanceof IndexColorModel)  {
+                if (transparencyType == Transparency.BITMASK) {
                 // Use 'transparent color'.
                 IndexColorModel icm = (IndexColorModel)cm;
                 int numColor = icm.getMapSize();
@@ -142,20 +143,18 @@
                     }
                 }
             }
+            } else {
+                cr = new Any2sRGBRed(cr);
+            }
 
             // Get our current ColorModel
             cm = cr.getColorModel();
 
             // It has an alpha channel so generate a soft mask.
-            if ((!this.isTransparent) && cm.hasAlpha()) {
+            if (!this.isTransparent && cm.hasAlpha())
                 this.softMask = new byte[this.width * this.height];
-            }
 
-            this.bitsPerPixel = 8;
-            this.bitmapsSize = this.width * this.height * 3;
-            this.bitmaps = new byte[this.bitmapsSize];
             this.colorSpace = cm.getColorSpace();
-
             WritableRaster wr = (WritableRaster)cr.getData();
             BufferedImage bi = new BufferedImage
                 (cm, wr.createWritableTranslatedChild(0, 0), 

