On 13.09.2006 13:51:35 Oliver Hernàndez Valls wrote: > Sorry if these questions are too obvious. > > > En/na Jeremias Maerki ha escrit: > > One more thing: The TIFFRenderer currently uses the internal codecs from > > XML Graphics Commons to encode TIFF images. > > I understand you are talking about > org.apache.xmlgraphics.image.codec.tiff.TIFFImageEncoder in the method > stopRenderer()
Yes. > These do not support writing > > CCITT-G4 encoded images. We could switch to the ImageWriters I wrote for > > Batik and which are now available in XML Graphics Commons. They allow an > > abstraction from the underlying codec for image writing. There are > > implementations of the ImageWriter that write images through ImageIO > > ImageIOTIFFImageWriter? That's only an implementation. I'm talking about the ImageWriter interface in general. You don't access implementations of the interface directly but only get an ImageWriter interface through the ImageWriterRegistry. The problem: FOP requires JDK 1.3 and ImageIO is not available there. In that case we still need to use the "internal codecs" (with not CCITT compression capability). In JDK >= 1.4 (including GNU Classpath based VMs) we'll use ImageIO and have TIFF capabilities when using the JAI ImageIO Tools. > > which might have CCITT-capable codecs available but the code will have > > to be extended to choose the compression algorithm. > > So you're talking about subclassing ImageIOTIFFImageWriter (into batik > or into fop?) or adding code into? to use, for example, TIFFFaxDecoder? No, maybe adjusting/improving the ImageIOTIFFImageWriter if it doesn't do the right things, yet. I'm going to write some example code later today that explains what I mean. > All in all, no easy > > solution to your requirement but certainly not much more than half a day > > of work. > > > > On 10.09.2006 12:54:46 Jeremias Maerki wrote: > >> There's a configuration value you can set to modify the compression used > >> but it's poorly designed (requiring an integer value) and undocumented. > >> Furthermore, it does not support setting CCITT-G4 compression. > >> Generating monochrome (1bit) images has also not been implemented, yet. > >> > >> To implement all this, changes would have to be made in: > >> - Java2DRenderer.getPageImage(): Extract code into a protected method to > >> instantiate the BufferedImage that we paint on. Right now, it always > >> allocates an 24 bit RGB image with an 8-bit alpha channel. > > OK > > >> - TIFFRenderer.LazyPageImagesIterator.next(): Code to handle 1bit images. > > Uncoment the code for TIFFEncodeParam.COMPRESSION_GROUP4? simply return > the BufferedImage generated in the protected method above (I think is > this one)? or some other hack? Yes, it could be as simple as that. Not sure, though. > >> - TIFFRenderer.configure(): provide better configuration using names for > >> compression methods. > > What does this method does or have to do? I don't undertand why this > method exists. It's reason is to log the compression? The configure() method is used to configure Renderer instances from the FOP user configuration file. You can then set the compression method in the configuration file and you don't have to instantiate and configure the renderer yourself. > >> - Override the new protected method described above to create the > >> Buffered image depending on the configuration. > > OK > > >> > >> If you don't want to hack FOP code, the work-around is to convert the > >> generated TIFF file after generation to CCITT format somehow. Obvious, > >> isn't it? :-) > >> > >> On 08.09.2006 11:04:22 Oliver Hernàndez Valls wrote: > >>> Hi all, > >>> I'm working with fop to generate MTIFF text images. At the moment i'm > >>> using fop-trunk because no justification functionality is working in fop > >>> 0.92 for tiffs. > >>> Right now I've all the functionality to generate parametrized text > >>> images implemented. By default fop uses packbits compression and colored > >>> image coding. > >>> I'd like to change the tiff coding to TIFF-G because generated images > >>> with the default tiff coding are very big (around 9000 kB) and > >>> coloration is not needed for the images I'm generating. > >>> I'm using the "new" FOUserAgent parameter setTargetResolution(int), but > >>> I can't see any way to change the default encoding for tiff images. > >>> Some time ago I readed this somewhere in the source code: "//TODO > >>> Support output of monochrome bitmaps (fax-style)", but don't know if it > >>> has something to do with changing tiff coding. > >>> > >>> Any hint/workarround/documentation please? Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
