You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by robrez <re...@gmail.com> on 2011/05/28 00:12:45 UTC

How to get a tiled TIFF from FOP rather than striped

Not really sure if this is a FOP question, a JAI question, or Both…

I am successfully producing a TIFF via fop using a configuration file that
has the following set for the renderer:
      [renderer mime="image/tiff"]
        [compression]CCITT T.4[/compression]
      [/renderer]

Because I am using CCITT compression, jai_imageio.jar is required. 

PROBLEM:  I am pulling my hair out trying to figure how to force TILED
rendering rather than STRIPED rendering of the tiff image. There does not
appear to be any obvious way to configure JAI to produce such results. 

The only approach that looked (somewhat) plausible was found on the
internets….
        FOUserAgent ua = fopFactory.newFOUserAgent();
        TIFFRenderer tr = new TIFFRenderer();
        TIFFImageWriteParam trp = new TIFFImageWriteParam(Locale.US);   
//requires jai_imageio.jar
        trp.setTilingMode(TIFFImageWriteParam.MODE_DEFAULT);
        ua.setRendererOverride(tr);

Which is swell… but, I don’t see any sort of ‘setImageWriteParam()’ method
ANYWHERE… the closest thing I’ve seen is –
        TIFFRenderer tr = new TIFFRenderer();
        ImageWriterParams imp = tr.getWriterParams();

And as far as I can tell, ImageWriterParams has nothing to do with
TIFFImageWriteParam (extends ImageWriteParam). All of the example code with
regards to TIFFImageWriteParam involves direct interaction with the output
stream… doesn’t really feel like something that is easily done or should
even be attempted given my exact usage – sending xsl-fo to FOP who is then
using JAI for tiff rendering.   

Any help would be greatly appreciated!!! 

-- 
View this message in context: http://old.nabble.com/How-to-get-a-tiled-TIFF-from-FOP-rather-than-striped-tp31720664p31720664.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: How to get a tiled TIFF from FOP rather than striped

Posted by "Marquart, Joshua D" <jo...@firstdata.com>.
Robrez-

This is actually an Apache XmlGraphics question that isn't specific to FOP.

ImageWriterParams is sorely lacking in functionality for TIFF rendering.

The class contains some JPEG-specific functionality and some TIFF-specific functionality, with some very minor crossover, but little in the way of customization.

I have expanded this functionality for my own purposes for TIFFs with the patch here (use the latest patch plus ResolutionUnit.java):

https://issues.apache.org/bugzilla/show_bug.cgi?id=50657 which allows explicit alteration of Resolution Unit, variable scaled resolutions and rows per strip.

It is an excellent starting point for expanding custom TIFF functionality.

-Josh

-----Original Message-----
From: robrez [mailto:resendez.java@gmail.com] 
Sent: Friday, May 27, 2011 6:13 PM
To: fop-users@xmlgraphics.apache.org
Subject: How to get a tiled TIFF from FOP rather than striped


Not really sure if this is a FOP question, a JAI question, or Both…

I am successfully producing a TIFF via fop using a configuration file that
has the following set for the renderer:
      [renderer mime="image/tiff"]
        [compression]CCITT T.4[/compression]
      [/renderer]

Because I am using CCITT compression, jai_imageio.jar is required. 

PROBLEM:  I am pulling my hair out trying to figure how to force TILED
rendering rather than STRIPED rendering of the tiff image. There does not
appear to be any obvious way to configure JAI to produce such results. 

The only approach that looked (somewhat) plausible was found on the
internets….
        FOUserAgent ua = fopFactory.newFOUserAgent();
        TIFFRenderer tr = new TIFFRenderer();
        TIFFImageWriteParam trp = new TIFFImageWriteParam(Locale.US);   
//requires jai_imageio.jar
        trp.setTilingMode(TIFFImageWriteParam.MODE_DEFAULT);
        ua.setRendererOverride(tr);

Which is swell… but, I don’t see any sort of ‘setImageWriteParam()’ method
ANYWHERE… the closest thing I’ve seen is –
        TIFFRenderer tr = new TIFFRenderer();
        ImageWriterParams imp = tr.getWriterParams();

And as far as I can tell, ImageWriterParams has nothing to do with
TIFFImageWriteParam (extends ImageWriteParam). All of the example code with
regards to TIFFImageWriteParam involves direct interaction with the output
stream… doesn’t really feel like something that is easily done or should
even be attempted given my exact usage – sending xsl-fo to FOP who is then
using JAI for tiff rendering.   

Any help would be greatly appreciated!!! 

-- 
View this message in context: http://old.nabble.com/How-to-get-a-tiled-TIFF-from-FOP-rather-than-striped-tp31720664p31720664.html
Sent from the FOP - Users mailing list archive at Nabble.com.




-----------------------------------------
The information in this message may be proprietary and/or
confidential, and protected from disclosure.  If the reader of this
message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify First Data
immediately by replying to this message and deleting it from your
computer.