]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
load original data properly
authorKeiron Liddle <keiron@apache.org>
Mon, 19 Aug 2002 11:54:53 +0000 (11:54 +0000)
committerKeiron Liddle <keiron@apache.org>
Mon, 19 Aug 2002 11:54:53 +0000 (11:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195097 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/image/AbstractFopImage.java
src/org/apache/fop/image/EPSImage.java
src/org/apache/fop/image/JpegImage.java
src/org/apache/fop/image/XMLImage.java
src/org/apache/fop/render/pdf/PDFRenderer.java

index 6e9e31c07dd06a2ceaf6385f64366c4e0cf2a25e..f9999f4dd40d98deb049ebe4948043b949ee7a4a 100644 (file)
@@ -126,6 +126,12 @@ public abstract class AbstractFopImage implements FopImage {
                 loaded = loaded | BITMAP;
             }
         }
+        if(((type & ORIGINAL_DATA) != 0) && ((loaded & ORIGINAL_DATA) == 0)) {
+            success = success && loadOriginalData(ua);
+            if(success) {
+                loaded = loaded | ORIGINAL_DATA;
+            }
+        }
         return success;
     }
 
@@ -137,6 +143,10 @@ public abstract class AbstractFopImage implements FopImage {
         return false;
     }
 
+    protected boolean loadOriginalData(FOUserAgent ua) {
+        return false;
+    }
+
     /**
      * Return the image URL.
      * @return the image URL (as String)
index 3867d2a20ba24806da80c26d5c381e5a8a797891..29323c3958283abc8e180961b14e0def741510d7 100644 (file)
@@ -71,6 +71,7 @@ public class EPSImage extends AbstractFopImage {
             bbox[2] = (int) epsData.bbox[2];
             bbox[3] = (int) epsData.bbox[3];
 
+            loaded = loaded | ORIGINAL_DATA;
         }
     }
 
index f1f64919e61b0569c4e60e8f31c183b8a7b88011..ee71a86ff305f0f7f295e64640a1b5ba48a1158d 100644 (file)
@@ -39,7 +39,7 @@ public class JpegImage extends AbstractFopImage {
         super(href, imgReader);
     }
 
-    protected boolean loadBitmap(FOUserAgent ua) {
+    protected boolean loadOriginalData(FOUserAgent ua) {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ByteArrayOutputStream iccStream = new ByteArrayOutputStream();
         InputStream inStream;
index a6e47df5061912a4a5415da72e711c063b5d4ed1..aa74eb0c9a30fc3a9a9402d23910ec2247cbc203 100644 (file)
@@ -29,6 +29,7 @@ public class XMLImage extends AbstractFopImage {
         super(href, imgInfo);
         if(imgInfo.data instanceof Document) {
             doc = (Document)imgInfo.data;
+            loaded = loaded | ORIGINAL_DATA;
         }
         ns = imgInfo.str;
     }
index 89ee1d70385ce03efc3684a916e77cfeb620c404..d3b0ddccd4eecc11e866be22cd115819a9ed8916 100644 (file)
@@ -516,7 +516,7 @@ public class PDFRenderer extends PrintRenderer {
             FopPDFImage pdfimage = new FopPDFImage(fopimage, url);
             int xobj = pdfDoc.addImage(null, pdfimage).getXNumber();
             fact.releaseImage(url, userAgent);
-        } else if ("image/jpg".equals(mime)) {
+        } else if ("image/jpeg".equals(mime)) {
             if (!fopimage.load(FopImage.ORIGINAL_DATA, userAgent)) {
                 return;
             }