xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46048] Wrong images used (how to clear image cache?)
Date Thu, 23 Oct 2008 11:48:09 GMT

--- Comment #18 from Jeremias Maerki <jeremias@apache.org>  2008-10-23 04:48:08 PST
Created an attachment (id=22771)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22771)
Proposed patch against FOP Trunk for URI pre-resolution

As promised I've looked into it (had some precious train time yesterday). I
found two possible approaches to "pre-resolve" the URI relative to a base URI,
so the image cache gets more absolute URIs. My first attempt was to build that
into the image loading framework but that caused a lot of changes (even API
changes). The second attempt is less invasive but needs changes in more than
one place in FOP (ExternalGraphic and all renderers). To illustrate this I've
just patched the PDFRenderer for the moment.

The patch uses java.net.URI (since Java 1.4) to do the URI resolution (using
URI.resolve(URI), not JAXP-style URIResolver resolution!). That seems to do the
job just fine. I'm not 100% sure this is ultimately the right approach which is
why I'm just posting a proposed patch here rather than doing the change
directly. The change itself should be pretty safe because if there's a problem
parsing the URI, the original URI is simply returned. Only relative URIs should
be affected.

The patch requires the Base URI (FOUserAgent.setBaseURL(String)) to be set for
the document. From the command-line this will be done automatically (the source
file's directory is used).

Feedback and further ideas welcome.

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message