[poppler] Request for comment: How inconsistent metrics of the image object should be dealt?

Adrian Johnson ajohnson at redneon.com
Wed Jan 21 03:25:45 PST 2015


On 20/01/15 11:23, suzuki toshiya wrote:
> Hi all,
> 
> Now I'm drafting the patch to emit the images coded by CCITT
> via CairoOutputDev without reencoding it. From the surface
> independence and portability, I think using TIFF is good to
> pass CCITT image to Cairo.

Can TIFF support all the PDF CCITT parameters? Are there TIFF CCITT
options not supported by PDF? Another option is to use a mime type for
the parameters. But this is best discussed on the cairo list.

> When I encapsulate CCITT bitstream
> into TIFF format, I need to put the metrics infos (CCITT
> bitstream itself does not have it, TIFF must have it). There
> are 2 different metrics infos may exist in PDF (Width/Height
> in Image dictionary and Columns/Rows in DecodeParms dictionary).
> There is a possibility that these properties are inconsistent.
> I'm not sure how I should deal such case.

The rows/columns in the CCITT filter parameters are used for decoding
the CCITT data, not displaying the image. The filters just return a
sequence of bytes. They don't care what the data is used for. You could
use a CCITT, DCT, or JPX filter for decompressing a content stream
although it wouldn't make sense to do so. The image dictionary
width/height is used to turn the sequence of bytes output from the
decompression filter into an image.

It is theoretically possible to have a different width/height values in
the image dictionary and the CCITT filter. As you note on your webpage
you could not find this occurring in 1000 PDF files so it probably never
occurs in practice.

> I did a small experiments with some data with inconsistent
> metrics, and I found that popular PDF browsers show different
> behaviours for such cases. Thus I think the inconsistent metrics
> should cause some errors. My experiment is summarized at
> 
> http://gyvern.ipc.hiroshima-u.ac.jp/~mpsuzuki/pdf-tech/ImagesWithIncorrectMetrics.html
> 
> If you have a comment how inconsistent metrics should be dealt,
> please let me know.

The xpdf and Adobe Reader output are correct. I also checked poppler and
ghostscript and they produce the same result.

> 
> Regards,
> mpsuzuki
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
> 



More information about the poppler mailing list