1999.08.20 16:31 "[Fwd: Re: What's wrong with this TIFF?]", by Helge Blischke
PostScript allows the direct inclusion of the binary CCITT Group IV data from a TIFF file. My program reads in a TIFF, converting it from multiple strips to a single strip, as necessary, and puts a PostScript wrapper around it. Generally things have worked well, but with certain images I'm getting a PostScript error in the middle of the TIFF data. The image was created in PaintShop Pro, then run through tiffcp to convert it to a single strip.
This is a bit off the point of the original poster, but since this question has been bugging me for a while, here it goes:
is there any way to create a level 2 postscript (or PDF) file which contain the sequence of encoded strips (with proper postscript code wrappers between them) rather than having to decode and re-encode the data as a single strip? All the tests that I've attempted seem to indicate that the answer is no, but I fail to understand why.
What I was trying to do is create a postscript file that does the following (all TIFFs are planar configuration, multi-strip G4 files):
ncols rowsperstrip g4image
0 offset translate
[ all data, encoded as ASCII85 G4 stream ]
nstrips = number of strips in the TIFF file,
ncols = image width
g4image = procedure that renderes g4-encoded data stream
offset = height of rendered image strip on the page
This doesn't seem to work reliably for all TIFFs (at least with the code that I wrote). Isn't it the case that a G4 TIFF strip is fundamentally equivalent to a G4 image and therefore I should be able to use the same Postscript code to render it?
Does any TIFF/postscript/PDF guru have any insight?
With an image made up of strips, it is relatively easy when using the dictionary version of the image operator. The basic idea is to use a procedure as data source that interprets the image data as a sequence of subfiles using strip_bytecount () /SubFileDecode filter for each strip. The other image dict entries are simply set up for the image as a whole.
With tiled images, it is a bit more complicated - tiles images must be processed as a sequence of distinct images, where I'ds suggest not to do scale and translate the tiles separately but rahter defining the position of the tiles using the image matrix. That's do avoid rounding errors - the image matrix deals with the image coordinate system, which uses pixels as unit.
If I totally disturbed your mind, drop me a note, I'll hack you a sketch then.