DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=36082>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36082 ------- Additional Comments From [EMAIL PROTECTED] 2005-08-10 14:32 ------- (In reply to comment #4) > The FOUserAgent.openStream() method is currently empty that's why I removed the > call and put the comment in. I see. I've just improved the documentation. http://svn.apache.org/viewcvs?rev=231213&view=rev > However, I since worked on the GIF crashing issue. > To make it work I had to change the interfaces. Instead of an InputStream the > ImageFactory.openStream function (renamed to openURLConnection()) returns a > URLConnection. This is then stored in addition to the InputStream in the > FopImage.ImageInfo structure so GifImage can use it to get the > properURLImageSource. > However, all this is done without using FOUserAgent. To move this logic into > FOUserAgent we would need a function in FOUserAgent like: > URL getURL(String url) > or may be better named > URL resolveURL(String url) > This would take the string argument url and combine it with the baseURL to form > a proper absolute URL. Ok, THAT is normal URI resolution which is also on the task list and should be done through a standard interface, i.e. these two: - http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/URIResolver.html - http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/EntityResolver.html Because this allows, among other things, the usage of XML Commons Resolver which is a frequently asked feature: http://xml.apache.org/commons/components/resolver/index.html > This would be the main function someone would overwrite in a FOUserAgent > subclass to provide custom URL resolution and to implement custom URL schemes. Actually, when the standard resolver interfaces are used, it should not be necessary to override FOUserAgent but simply to set a URIResolver and/or a EntityResolver. > We could then add helper functions to FOUserAgent like: > URLConnection openConnection(String url) I'm against that. That would mean that people would have to have URLConnection implementations for their custom code and cannot simply provide an InputStream. Our code should manage to handle that, too. Implementing URLConnection subclasses may be too much hassle for some developers. > which would first resolve the url and then do an openConnection on it and > similar: > InputStream openStream(String url) > which would call openConnection(url) first and then return its InputStream. > These helpers may save a few lines of code in a few places in fop but are not > really core. We should also make sure we don't do too much and therefore make the whole FOUserAgent too complicated. URI resolution using the standard interfaces is a must at some point, getStream() is nice to have and should be sufficient for most people. If GIF can't be loaded through a pure InputStream, we have to find a different solution. > Comments please ? Am I on the right track? Don't bite too much into GIF. If we can't make GIF support work properly with the (old) classes from the JDK, it's not a big deal IMO to require Jimi or JAI to be present under JDK 1.3. Under JDK 1.4 we have ImageIO (javax.imageio.ImageIO) that should provide easier access to a GIF codec if my memory doesn't desert me. So it might finally be the right time to introduce an AbstractFopImage subclass using ImageIO (placed under src/java-1.4). I've started such a class but never committed it since the priorization of image providers was not sufficient. I can retest that class and commit it if necessary. So to sum: - FOUserAgent.getStream() is cool and very easy to use (now that it's properly documented). People will want to load images from a CMS without having to write an URL handler. URIs like "cms:823746843?lng=fr" for example. - URI resolution using XML Commons Resolver should be possible, i.e. URIResolver and ideally EntityResolver should be supported, i.e. FOP should be able to extract the necessary infos out of Source and InputSource instances when loading images. - If you can make the whole thing work for GIF by directly working with an URLConnection that's cool, but I wouldn't expose something like URLConnection to the outside of FOP. - Investigate ImageIO as an alternative means to load GIF. Sorry for the trouble and and I hope I'm making sense. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
