You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by gm...@apache.org on 2003/12/27 21:40:04 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/flow ExternalGraphic.java

gmazza      2003/12/27 12:40:04

  Modified:    src/java/org/apache/fop/fo/flow ExternalGraphic.java
  Log:
  Bug 25758 (patch by Finn Bock) -- Fix of content-height/content-width
  for images, to satisfy NIST test adp-height1.fo
  
  Revision  Changes    Path
  1.13      +6 -5      xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
  
  Index: ExternalGraphic.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ExternalGraphic.java	20 Dec 2003 06:53:22 -0000	1.12
  +++ ExternalGraphic.java	27 Dec 2003 20:40:04 -0000	1.13
  @@ -167,13 +167,14 @@
                   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);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org