https://issues.apache.org/bugzilla/show_bug.cgi?id=46048





--- Comment #7 from M.H. <[EMAIL PROTECTED]>  2008-10-21 03:34:37 PST ---
As there is no method to clear the image cache, I now have a working
workaround:
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 {
        super();

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

            final FOUserAgent ua = ff.newFOUserAgent();
            ua.setBaseURL(fopUserAgent.getBaseURL());
            ua.setURIResolver(fopUserAgent.getURIResolver());

            ff.setStrictValidation(fopFactory.validateStrictly());
            if (fopFactory.getFontBaseURL() != null) {
                ff.setFontBaseURL(fopFactory.getFontBaseURL());
            }
            ff.setUserConfig(fopFactory.getUserConfig());

            fopFactory = ff;
        }
    }//FOP()
-----------------------------------

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.

Reply via email to