
Thread
2004.09.14 13:50 "[Tiff] Removing reduced resolution pages", by Han The Man
Hi all,
I have about 50.000 TIFF files, some of them having pages with "reduced-resolution" pages.
I want to remove any pages in those TIFF files marked as reduced-resolution. So in essence, I want to replace the original file with a new file not having reduced-resolution pages.
Can I do that reliably using libtiff?
Below is a sample output from TIFFINFO. I know (by visual inspection) that the reduced resolution images are at page 2 and 4.
The subfiletype is 0x03 for page 2 and 4, but according to the TIFF 6.0 spec about "Subfiletype", 0x03 means "a single page of a multipage image".
Shouldn't TIFFINFO print 0x02 - "reduced-resolution image".
What am I missing?
Also, how can I best remove reduced-resolution pages from my TIFF files?
Best,
Han
------ TIFFINFO OUTPUT ---
TIFF Directory at offset 0x8
Subfile Type: multi-page document (2 = 0x2)
Image Width: 2472 Image Length: 3504
Tile Width: 512 Tile Length: 512
Resolution: 300, 300 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Date & Time: "2002:11:11 11:11:11"
Image Description: "(removed)"
Make: "(removed)"
Model: "(removed)"
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Planar Configuration: single image plane
Software: (removed)
Tag 34860: (removed)
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x9cec
Subfile Type: reduced-resolution image/multi-page document (3 = 0x3)
Image Width: 618 Image Length: 876
Tile Width: 512 Tile Length: 512
Resolution: 75, 75 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Planar Configuration: single image plane
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0xc2e4
Subfile Type: multi-page document (2 = 0x2)
Image Width: 2472 Image Length: 3504
Tile Width: 512 Tile Length: 512
Resolution: 300, 300 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Date & Time: "2002:11:11 11:11:11"
Image Description: "(removed)"
Make: "(removed)"
Model: "(removed)"
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Planar Configuration: single image plane
Software: (removed)
Tag 34860: (removed)
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x11cc0
Subfile Type: reduced-resolution image/multi-page document (3 = 0x3)
Image Width: 618 Image Length: 876
Tile Width: 512 Tile Length: 512
Resolution: 75, 75 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Planar Configuration: single image plane
Group 4 Options: (0 = 0x0)