diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-08-15 10:34:31 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-08-15 10:34:31 +0000 |
commit | a349b7be0b545f1e17dda314d6622d2f60458821 (patch) | |
tree | fb57b8092d8fdbb05a56f854e3cdca34247e531c /src/java/org/apache/fop/fo | |
parent | d432b9cdfb206b1dbaeb51167c40a141af71c4ae (diff) | |
download | xmlgraphics-fop-a349b7be0b545f1e17dda314d6622d2f60458821.tar.gz xmlgraphics-fop-a349b7be0b545f1e17dda314d6622d2f60458821.zip |
Bugzilla #36082
1. Addresses the URI resolving issue as discussed in this bug by providing a
FOP implementation of the URIResolver interface as well as the capabilities to
set a URIResolver on the FOUserAgent object.
2. Modifies the BMPReader to extract the resolution information.
3. Fixes a possible array bounds exception in BMPImage which can happen for BMP
images with extra bytes at the end.
4. Provides some infrastructure in ImageFactory in preparation of external
configuration of multiple prioritised image providers per mime type.
5. Sets a proper base URL in SVGElement.
6. Provides test cases and test images for the different formats and
resolutions.
Submitted by: Manuel Mall <mm.at.arcus.com.au>
Patch slightly modified:
- EPS sample graphic exchanged with a very simple and more importantly much smaller one generated by Barcode4J.
- Enabled resolution checking for some of the format-specific testcases (especially after working around resolution detection for PNG)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@232786 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo')
-rw-r--r-- | src/java/org/apache/fop/fo/extensions/svg/SVGElement.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java index 7dfd3dd22..19fc06a3a 100644 --- a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java +++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,9 +80,11 @@ public class SVGElement extends SVGObj { /* if width and height are zero, get the bounds of the content. */ try { - String baseDir = getUserAgent().getBaseURL(); - if (baseDir != null) { - ((SVGOMDocument)doc).setURLObject(new URL(baseDir)); + URL baseURL = new URL(getUserAgent().getBaseURL() == null + ? new java.io.File("").toURL().toExternalForm() + : getUserAgent().getBaseURL()); + if (baseURL != null) { + ((SVGOMDocument)doc).setURLObject(baseURL); } } catch (Exception e) { getLogger().error("Could not set base URL for svg", e); |