aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/image
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-07-31 16:23:51 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-07-31 16:23:51 +0000
commitc416edbaae9fe4ecd77ecd35e5bbd8edf524e489 (patch)
tree907f3dadb280993349547dac82ad033f773daf76 /src/java/org/apache/fop/image
parentd71f26e615fb573e19786a8297959dbb0f5741ef (diff)
downloadxmlgraphics-fop-c416edbaae9fe4ecd77ecd35e5bbd8edf524e489.tar.gz
xmlgraphics-fop-c416edbaae9fe4ecd77ecd35e5bbd8edf524e489.zip
Merged revisions 681296,681307 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ................ r681296 | jeremias | 2008-07-31 09:07:42 +0100 (Thu, 31 Jul 2008) | 12 lines Blocked revisions 681286,681291 via svnmerge ........ r681286 | jeremias | 2008-07-31 09:15:23 +0200 (Do, 31 Jul 2008) | 1 line Move to XML Graphics Commons 1.3.1. ........ r681291 | jeremias | 2008-07-31 09:45:13 +0200 (Do, 31 Jul 2008) | 1 line Increase version number. ........ ................ r681307 | jeremias | 2008-07-31 10:06:10 +0100 (Thu, 31 Jul 2008) | 149 lines Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-638936,638938-640888,640890-642905,642907-647402,647404-647536,647538-648983,648985-649005,649007-649013,649015-650549,650551-651301,651303-653536,653538-654452,654454-656285,656287-656523,656525-657519,657521-661579,661581-663481,663483-664691,664693-681285,681287-681290,681292-681298 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r666635 | jeremias | 2008-06-11 14:18:53 +0200 (Mi, 11 Jun 2008) | 1 line Fixed resolution handling inside AWT preview dialog. ........ r666662 | jeremias | 2008-06-11 15:33:20 +0200 (Mi, 11 Jun 2008) | 1 line Some notes on RTF and print output. ........ r668533 | jeremias | 2008-06-17 09:57:55 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45151: Note on the "compiling" page that Ant 1.7 is required. The README file already points to this page. ........ r668534 | jeremias | 2008-06-17 09:58:40 +0200 (Di, 17 Jun 2008) | 2 lines Update known issues. Remove ApacheConEU logo. ........ r668550 | jeremias | 2008-06-17 10:05:22 +0200 (Di, 17 Jun 2008) | 2 lines Bugzilla #45146: Removed duplicate LICENSE.txt and Notice.txt from the JAR. ........ r668570 | jeremias | 2008-06-17 10:54:07 +0200 (Di, 17 Jun 2008) | 1 line Wrong line number reported in the case of a line overflow. ........ r668641 | jeremias | 2008-06-17 14:59:25 +0200 (Di, 17 Jun 2008) | 1 line Fixed potential NPE. ........ r669118 | jeremias | 2008-06-18 11:02:45 +0200 (Mi, 18 Jun 2008) | 4 lines Bugzilla #44412: Regression fix for empty pages caused by multiple collapsible breaks. No more empty block areas if a break-before occurs on the first child of an FO to match the behaviour of tables and other FO implementations (clarification by XSL WG pending). Added an accessor interface for break-before/-after to avoid long if..else lists in BlockStackingLayoutManager. ........ r669173 | jeremias | 2008-06-18 16:07:27 +0200 (Mi, 18 Jun 2008) | 7 lines Bugzilla #44887: Fixed potential multi-threading problem concerning the use of DecimalFormat. Results from performance measurements in a separate test (operation repeated 100'000 times, exemplary): shared static variable: ~220ms (old choice, problematic!) always create new instance: ~480ms ThreadLocal: ~220ms (new choice) ........ r669478 | jeremias | 2008-06-19 15:03:57 +0200 (Do, 19 Jun 2008) | 4 lines Bugzilla #44412: Improvements after Vincent's feedback: Removal of the somewhat ugly Reference. getBreakBefore() reduced to private visibility. ........ r670551 | jeremias | 2008-06-23 14:54:27 +0200 (Mo, 23 Jun 2008) | 3 lines Use configured source and target resolution for foreign objects in RTF output. Fixed intrinsic size calculation for SVG images when source resolution is not 72 dpi. Fixed calculation of px2mm values in the SVG to G2D converter (used by RTF output). ........ r673750 | adelmelle | 2008-07-03 20:25:01 +0200 (Do, 03 Jul 2008) | 1 line Fix for Bugzilla 45295 (already committed to the trunk with r672010, r672495 and r672496) ........ r674304 | jeremias | 2008-07-06 17:09:10 +0200 (So, 06 Jul 2008) | 18 lines Bugzilla #43606: column-width accepts percent values (proportional-column-width and % working) Table width accepts percent values (100% of the page width as standard) Nested tables are working It is also possible to make nested tables with a higher depth than 3 without causing word to crash Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Patch simplified (reuse of ColumnSetup from the layoutmgr package) - Percentages and proportional-column-width didn't work properly in my tests -> fixed - Adjustments for FOP code conventions Bugzilla #43824: page-number-citation working but has to be refreshed inside word to show the correct values Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674314 | jeremias | 2008-07-06 18:40:08 +0200 (So, 06 Jul 2008) | 7 lines Bugzilla #43825: leader supports fixed percent values for leader-length, most other properties use-content, leader-pattern-width not implemented Submitted by: Maximilan Aster <maximilian.aster.at.boc-eu.com> Changes to the patch by Jeremias: - Adjustments for FOP code conventions ........ r674317 | jeremias | 2008-07-06 18:44:43 +0200 (So, 06 Jul 2008) | 1 line Doc update after RTF changes. ........ r675106 | jeremias | 2008-07-09 09:03:46 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #45366: Document missing feature. ........ r675150 | jeremias | 2008-07-09 14:56:41 +0200 (Mi, 09 Jul 2008) | 2 lines Bugzilla #39980: Fixed image scaling for RTF output. ........ r675151 | jeremias | 2008-07-09 14:57:06 +0200 (Mi, 09 Jul 2008) | 1 line Removed unused code. ........ r675152 | jeremias | 2008-07-09 14:58:18 +0200 (Mi, 09 Jul 2008) | 1 line Don't generate commands for default values. ........ r675707 | jeremias | 2008-07-10 21:58:27 +0200 (Do, 10 Jul 2008) | 1 line Bugfix: -imagein didn't work because the stylesheet didn't get copied into fop.jar. ........ r680715 | jeremias | 2008-07-29 16:37:10 +0200 (Di, 29 Jul 2008) | 1 line Found a surplus "pop state" which somehow causes a regression (fill color doesn't get properly reset) between 0.94 and 0.95. Shows in Barcode4J's fop-extension-demo.fo. The line has already been there in 0.94 but only shows in 0.95 probably due to an additional save/restore state pair added in PDFRenderer for reference areas after the block-container area refactoring. ........ r680820 | jeremias | 2008-07-29 22:02:14 +0200 (Di, 29 Jul 2008) | 2 lines Bugzilla #41306: The AWT Renderer is really not out-of-order capable. ........ r681284 | jeremias | 2008-07-31 08:47:49 +0200 (Do, 31 Jul 2008) | 1 line Some updates to status.xml (I was not the only one working on the final release). ........ r681290 | jeremias | 2008-07-31 09:44:51 +0200 (Do, 31 Jul 2008) | 2 lines Website updates for the 0.95 release. The projectInfo plug-in of Forrest is not ideal for doing a bugfix release. It's not possible to combine the changes for two releases. ........ r681292 | jeremias | 2008-07-31 09:47:13 +0200 (Do, 31 Jul 2008) | 1 line Disabling the ApacheCon ad for the release build. ........ ................ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@681410 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/image')
-rw-r--r--src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java4
-rw-r--r--src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java14
2 files changed, 13 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java b/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
index b7ea72bf0..624d99fc0 100644
--- a/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
+++ b/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
@@ -68,10 +68,10 @@ public class ImageConverterSVG2G2D extends AbstractImageConverter {
}
//Prepare
- float pxToMillimeter = (float)UnitConv.mm2in(72); //default: 72dpi
+ float pxToMillimeter = UnitConv.IN2MM / 72; //default: 72dpi
Number ptm = (Number)hints.get(ImageProcessingHints.SOURCE_RESOLUTION);
if (ptm != null) {
- pxToMillimeter = (float)UnitConv.mm2in(ptm.doubleValue());
+ pxToMillimeter = (float)(UnitConv.IN2MM / ptm.doubleValue());
}
UserAgent ua = createBatikUserAgent(pxToMillimeter);
GVTBuilder builder = new GVTBuilder();
diff --git a/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java b/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
index ce6cde9d9..916b80d02 100644
--- a/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
+++ b/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
@@ -46,6 +46,7 @@ import org.apache.xmlgraphics.image.loader.impl.AbstractImagePreloader;
import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
import org.apache.xmlgraphics.image.loader.util.ImageUtil;
import org.apache.xmlgraphics.util.MimeConstants;
+import org.apache.xmlgraphics.util.UnitConv;
import org.apache.fop.svg.SimpleSVGUserAgent;
import org.apache.fop.util.UnclosableInputStream;
@@ -119,7 +120,7 @@ public class PreloaderSVG extends AbstractImagePreloader {
in.mark(length + 1);
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(
getParserName());
- doc = (SVGDocument) factory.createSVGDocument(src.getSystemId(), in);
+ doc = factory.createSVGDocument(src.getSystemId(), in);
}
ImageInfo info = createImageInfo(uri, context, doc);
@@ -154,7 +155,7 @@ public class PreloaderSVG extends AbstractImagePreloader {
private ImageInfo createImageInfo(String uri, ImageContext context, SVGDocument doc) {
Element e = doc.getRootElement();
- float pxUnitToMillimeter = 25.4f / context.getSourceResolution();
+ float pxUnitToMillimeter = UnitConv.IN2MM / context.getSourceResolution();
UserAgent userAg = new SimpleSVGUserAgent(pxUnitToMillimeter,
new AffineTransform()) {
@@ -184,9 +185,12 @@ public class PreloaderSVG extends AbstractImagePreloader {
float height = UnitProcessor.svgVerticalLengthToUserSpace(
s, SVGOMDocument.SVG_HEIGHT_ATTRIBUTE, uctx);
+ int widthMpt = (int)Math.round(px2mpt(width, context.getSourceResolution()));
+ int heightMpt = (int)Math.round(px2mpt(height, context.getSourceResolution()));
+
ImageInfo info = new ImageInfo(uri, MimeConstants.MIME_SVG);
ImageSize size = new ImageSize();
- size.setSizeInMillipoints(Math.round(width * 1000), Math.round(height * 1000));
+ size.setSizeInMillipoints(widthMpt, heightMpt);
//Set the resolution to that of the FOUserAgent
size.setResolution(context.getSourceResolution());
size.calcPixelsFromSize();
@@ -210,4 +214,8 @@ public class PreloaderSVG extends AbstractImagePreloader {
}
+ private static double px2mpt(double px, double resolution) {
+ return px * 1000 * UnitConv.IN2PT / resolution;
+ }
+
}