aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2011-06-21 15:07:50 +0000
committerJeremias Maerki <jeremias@apache.org>2011-06-21 15:07:50 +0000
commit634a8abadc68ea5727410dc08b8aab2aa7a6c3a6 (patch)
treef64c74ed40c5c96bd4f9d9add5e761c8e531824e /src
parentd54e7a66815bf4082707780e2a463404995cc3ae (diff)
downloadxmlgraphics-fop-634a8abadc68ea5727410dc08b8aab2aa7a6c3a6.tar.gz
xmlgraphics-fop-634a8abadc68ea5727410dc08b8aab2aa7a6c3a6.zip
Fixed regression introduced by rev 1137971:
Bi-level images that are generated as page segments and don't need to be resampled produced garbled output because the size of the image data got set to wrong values. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1138036 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java b/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
index 61ac06382..c516da702 100644
--- a/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
+++ b/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
@@ -151,6 +151,7 @@ public class AFPImageHandlerRenderedImage extends AFPImageHandler implements Ima
private boolean useFS10;
private int maxPixelSize;
private boolean usePageSegments;
+ private boolean resample;
private Dimension resampledDim;
private ImageSize intrinsicSize;
private ImageSize effIntrinsicSize;
@@ -187,8 +188,14 @@ public class AFPImageHandlerRenderedImage extends AFPImageHandler implements Ima
(int)Math.ceil(UnitConv.mpt2px(targetSize.getWidth(), resolution)),
(int)Math.ceil(UnitConv.mpt2px(targetSize.getHeight(), resolution)));
resourceInfo.setImageDimension(resampledDim);
- effIntrinsicSize = new ImageSize(
- resampledDim.width, resampledDim.height, resolution);
+ //Only resample/downsample if image is smaller than its intrinsic size
+ //to make print file smaller
+ this.resample = resampledDim.width < renderedImage.getWidth()
+ && resampledDim.height < renderedImage.getHeight();
+ if (resample) {
+ effIntrinsicSize = new ImageSize(
+ resampledDim.width, resampledDim.height, resolution);
+ }
}
//Update image object info
@@ -221,11 +228,7 @@ public class AFPImageHandlerRenderedImage extends AFPImageHandler implements Ima
imageObjectInfo.setCreatePageSegment(true);
float ditheringQuality = paintingState.getDitheringQuality();
- //Only resample/downsample if image is smaller than its intrinsic size
- //to make print file smaller
- boolean resample = resampledDim.width < renderedImage.getWidth()
- && resampledDim.height < renderedImage.getHeight();
- if (resample) {
+ if (this.resample) {
if (log.isDebugEnabled()) {
log.debug("Resample from " + intrinsicSize.getDimensionPx()
+ " to " + resampledDim);