aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-08-19 11:54:53 +0000
committerKeiron Liddle <keiron@apache.org>2002-08-19 11:54:53 +0000
commita3f76e82f9ff8c206c9d4cd41f7064d2355f980a (patch)
tree8767644cd5da7d0991f54a85674a4fa3561ced71 /src/org/apache/fop
parent48d3c4f4d913224c8c1be3086b280facd5bf75cb (diff)
downloadxmlgraphics-fop-a3f76e82f9ff8c206c9d4cd41f7064d2355f980a.tar.gz
xmlgraphics-fop-a3f76e82f9ff8c206c9d4cd41f7064d2355f980a.zip
load original data properly
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195097 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop')
-rw-r--r--src/org/apache/fop/image/AbstractFopImage.java10
-rw-r--r--src/org/apache/fop/image/EPSImage.java1
-rw-r--r--src/org/apache/fop/image/JpegImage.java2
-rw-r--r--src/org/apache/fop/image/XMLImage.java1
-rw-r--r--src/org/apache/fop/render/pdf/PDFRenderer.java2
5 files changed, 14 insertions, 2 deletions
diff --git a/src/org/apache/fop/image/AbstractFopImage.java b/src/org/apache/fop/image/AbstractFopImage.java
index 6e9e31c07..f9999f4dd 100644
--- a/src/org/apache/fop/image/AbstractFopImage.java
+++ b/src/org/apache/fop/image/AbstractFopImage.java
@@ -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)
diff --git a/src/org/apache/fop/image/EPSImage.java b/src/org/apache/fop/image/EPSImage.java
index 3867d2a20..29323c395 100644
--- a/src/org/apache/fop/image/EPSImage.java
+++ b/src/org/apache/fop/image/EPSImage.java
@@ -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;
}
}
diff --git a/src/org/apache/fop/image/JpegImage.java b/src/org/apache/fop/image/JpegImage.java
index f1f64919e..ee71a86ff 100644
--- a/src/org/apache/fop/image/JpegImage.java
+++ b/src/org/apache/fop/image/JpegImage.java
@@ -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;
diff --git a/src/org/apache/fop/image/XMLImage.java b/src/org/apache/fop/image/XMLImage.java
index a6e47df50..aa74eb0c9 100644
--- a/src/org/apache/fop/image/XMLImage.java
+++ b/src/org/apache/fop/image/XMLImage.java
@@ -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;
}
diff --git a/src/org/apache/fop/render/pdf/PDFRenderer.java b/src/org/apache/fop/render/pdf/PDFRenderer.java
index 89ee1d703..d3b0ddccd 100644
--- a/src/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/org/apache/fop/render/pdf/PDFRenderer.java
@@ -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;
}