diff options
author | Peter Hancock <phancock@apache.org> | 2011-11-01 12:20:21 +0000 |
---|---|---|
committer | Peter Hancock <phancock@apache.org> | 2011-11-01 12:20:21 +0000 |
commit | fd263a114c84c3756ead9c16b8b088531c5cab2c (patch) | |
tree | 4cd6ba7c8fe3a144629477ac911b2651707bdb03 /src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java | |
parent | 54a4751b616ab4e8957b97af4088bd725367ea6f (diff) | |
download | xmlgraphics-fop-fd263a114c84c3756ead9c16b8b088531c5cab2c.tar.gz xmlgraphics-fop-fd263a114c84c3756ead9c16b8b088531c5cab2c.zip |
Bugzilla#52089: Allow JPEG images to be embedded in an AFP document as
is, without being decoded and encoded. It also allows lossy JPEG compression.
Patch by Jeremias Maerki and Mehdi Houshmand.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1195952 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java')
-rw-r--r-- | src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java b/src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java index 79e4979fd..d1c693afb 100644 --- a/src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java +++ b/src/java/org/apache/fop/afp/AFPDitheredRectanglePainter.java @@ -90,22 +90,18 @@ public class AFPDitheredRectanglePainter extends AbstractAFPPainter { imageObjectInfo.setData(dither); //Positioning - AFPObjectAreaInfo objectAreaInfo = new AFPObjectAreaInfo(); int rotation = paintingState.getRotation(); AffineTransform at = paintingState.getData().getTransform(); Point2D origin = at.transform(new Point2D.Float( rectanglePaintInfo.getX() * 1000, rectanglePaintInfo.getY() * 1000), null); - objectAreaInfo.setX((int)Math.round(origin.getX())); - objectAreaInfo.setY((int)Math.round(origin.getY())); AFPUnitConverter unitConv = paintingState.getUnitConverter(); float width = unitConv.pt2units(rectanglePaintInfo.getWidth()); float height = unitConv.pt2units(rectanglePaintInfo.getHeight()); - objectAreaInfo.setWidth(Math.round(width)); - objectAreaInfo.setHeight(Math.round(height)); - objectAreaInfo.setHeightRes(resolution); - objectAreaInfo.setWidthRes(resolution); - objectAreaInfo.setRotation(rotation); + AFPObjectAreaInfo objectAreaInfo = new AFPObjectAreaInfo( + (int) Math.round(origin.getX()), + (int) Math.round(origin.getY()), + Math.round(width), Math.round(height), resolution, rotation); imageObjectInfo.setObjectAreaInfo(objectAreaInfo); //Create rectangle |