2012.08.27 15:44 "[Tiff] Unitless TIFF file results in page size in points instead of inches", by Aaron Trewern

2012.08.27 15:44 "[Tiff] Unitless TIFF file results in page size in points instead of inches", by Aaron Trewern

I have a TIFF file with the details below. I expected tiff2pdf to convert this to a letter size (8.5x11") page instead the result a PDF file with a page size 8.5x11 points ~ 0.12x0.15 inches.

The man page implied that the default unit was inches but it looks the source simply divides the image width by the resolution to get the PDF page width in points.

Is this the expected behaviour?

If I set the x and y resolution to 4 or 5 dpi (~ 300 / 72) then the result is more like my expectation but this only solves this specific issue. I am batch converting TIFF files of varying sizes from various sources and using theparameters "-r o -u i -x 5 -x 5" does not seem appropriate.

TIFF Directory at offset 0x8 (8)
    Image Width: 2560 Image Length: 3300
    Resolution: 300, 300 (unitless)
    Compression Scheme: CCITT Group 4
    Photometric Interpretation: min-is-black
    Samples/Pixel: 1
    Rows/Strip: 1
    Planar Configuration: single image plane

TIFF Directory at offset 0x1dd0c (122124)
    Image Width: 2560 Image Length: 3300
    Resolution: 300, 300 (unitless)
    Compression Scheme: CCITT Group 4
    Photometric Interpretation: min-is-black
    Samples/Pixel: 1
    Rows/Strip: 1
    Planar Configuration: single image plane

tiff2pdf.c: t2p_compose_pdf_page
<-- snip -->
   } else if (t2p->tiff_resunit != RESUNIT_CENTIMETER /* RESUNIT_NONE and */
        && t2p->tiff_resunit != RESUNIT_INCH) { /* other cases */
        t2p->pdf_imagewidth = ((float)(t2p->tiff_width))/t2p->pdf_xres;
        t2p->pdf_imagelength = ((float)(t2p->tiff_length))/t2p->pdf_yres;
    } else {
<-- snip -->

TIA Aaron.