I haven't looked into it in detail but what you say makes sense. If possible I'd try to use loadOriginalData() as much as possible even if I needed to stretch the meaning a bit. I'm sure you'll figure out the right way.
On 15.08.2005 16:04:00 Manuel Mall wrote: > > On Sun, 14 Aug 2005 09:14 pm, Jeremias Maerki wrote: > > Oh, right, looks like the CCFFilter needs to be ported from the > > maintenance branch to the trunk. I didn't remember that one. The > > Batik codecs are actually not so much involved in this case, since > > the TIFF doesn't have to be fully decoded. Have a look at how JPEG is > > handled. The JPEGs are simply analyzed by the JPEGReader and the > > directly provided as a byte stream (undecoded) in JPEGImage to the > > renderers. > > > > http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-m > >aintain/src/org/apache/fop/pdf/CCFFilter.java > > > Adding CCFFilter from 0.20.5 is the easy bit and I have done that. > Unfortunately the JPEG handling model is not quite suitable for TIFF and > that's where I am stuck. For JPEG a PDF document can include the whole > file as part of the DCTFilter. This is not true for TIFF. Only certain > TIFF formats are supported by the CCFFilter and only the actual image > data from the TIFF file goes into the filter. All the meta information, > e.g. the TIFF directory, is not stored in the PDF file. Therefore I > cannot really use the FopImage.loadOriginalData() function because it > would load the full data. Of course I could give that function a > different meaning in the TIFF context but that may stuff up other > render implementations in the future which assume that this function > returns all the data but may be thats not such a big deal. In addition > TIFF is currently supported through BatikImage. I don't think once > Batik has the inputstream decoded, e.g. read the TIFF directory, I have > access to the raw data required for the CCFFilter. > > So I suggest the following. We provide two TIFF image implementations. > One based on JAI as in 0.20.5 which allows native embedding in a PDF > using the CCFFilter and one through Batik. If JAI is available the JAI > TIFF implementation is chosen and smaller PDFs are produced in other > environments the Batik variant is used. > > Does that sound OK? Jeremias Maerki
