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 Tue, 21 Oct 2008 10:34:37 GMT

--- Comment #7 from M.H. <mhilpert@gmx.de>  2008-10-21 03:34:37 PST ---
As there is no method to clear the image cache, I now have a working
iin my custom "FOP" class I introduced a new constructor to create a new
FopFactory to finally get rid of all cached images:

     * Constructor.
     * Workaround image cache problem: each FopFactory has its own image cache.
As a custom URIResolver (to set unique image file names)
     * is not considered by the imageCache (FOP 0.95), the image cache must be
cleared. But as there is not such clear method anymore (FOP 0.95)
     * we create a complete new FopFactory.
     * This constructor should be called with parameter 'true' for serialized
FOP calls to avoid image caching problems.
     * @param newFactory If true, create a new FopFactory and try to copy
config values from the former FopFactory and UserAgent.
    public FOP(final boolean newFactory) throws Exception {

        if (newFactory) {
            final FopFactory ff = FopFactory.newInstance();

            final FOUserAgent ua = ff.newFOUserAgent();

            if (fopFactory.getFontBaseURL() != null) {

            fopFactory = ff;

I guess the problem is the image caching of FOP not taking custom URIResolvers
into account.

(Why is this bug "resolved worksforme"? This is a clear bug as I described it

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