diff options
author | Glen Mazza <gmazza@apache.org> | 2003-12-27 20:40:04 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2003-12-27 20:40:04 +0000 |
commit | d0cb3249faf74ff6aafb9005a447760c02c902c5 (patch) | |
tree | b5da66f15981cdfca0636282fa077f387f49b89e /src/java/org/apache/fop | |
parent | 4425dafeb0d69048a21d26c3b2ac9ccbf3a87942 (diff) | |
download | xmlgraphics-fop-d0cb3249faf74ff6aafb9005a447760c02c902c5.tar.gz xmlgraphics-fop-d0cb3249faf74ff6aafb9005a447760c02c902c5.zip |
Bug 25758 (patch by Finn Bock) -- Fix of content-height/content-width
for images, to satisfy NIST test adp-height1.fo
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197057 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r-- | src/java/org/apache/fop/fo/flow/ExternalGraphic.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java index 2b3430fbf..dc0632516 100644 --- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java @@ -167,13 +167,14 @@ public class ExternalGraphic extends FObj { url = null; return; } - if (cwidth == -1) { + if (cwidth == -1 && cheight == -1) { cwidth = (int)(fopimage.getWidth() * 1000); - } - if (cheight == -1) { cheight = (int)(fopimage.getHeight() * 1000); - } - if (scaling == Scaling.UNIFORM) { + } else if (cwidth == -1) { + cwidth = (int)(fopimage.getWidth() * cheight) / fopimage.getHeight(); + } else if (cheight == -1) { + cheight = (int)(fopimage.getHeight() * cwidth) / fopimage.getWidth(); + } else { // adjust the larger double rat1 = cwidth / (fopimage.getWidth() * 1000f); double rat2 = cheight / (fopimage.getHeight() * 1000f); |