2010.04.29 19:38 "Re: [Tiff] Tiff Digest, Vol 71, Issue 10", by Richard Nolde
On 04/29/2010 11:00 AM, firstname.lastname@example.org wrote: > tiffcrop -e combined -U in -X 8.26 very_long_page.tiff cropped.tiff Several suggestions:
The export flag, -e, is used to define how multiple selections for a single image are presented in the output image file. Using -e combined would take multiple selections from a given image and combine them into a single image in the output file. What you want is -e divided so create separate images for each selection but write them all to one output file.
The -X flag is used to select a single section of an image of a given width. Without any other specifier, the entire length of the image will be used. I suspect you want something link -Y 11.694, assuming Unit of inches as you have specified above.
What you really want is multiple selections of a given size, not just one as will be produced using -X and/or -Y.
Several options might work for you. Using the -Z zonelist option with -e divided, produces two pages within a single file, eg the upper half 1:2 and the lower half 2:2.
tiffcrop -Z1:2,2:2 -e divided very_long_page.tiff fax2page-1.tiff
Using -z coordinate pairs gives you even more control of the exact start and end of each output page.
tiffcrop -z0,0,1728,2198:0,2199,1728,4396 -e divided very_long_page.tiff fax2page-2.tiff
Using the -Scols:row option breaks the image into individual subsets of X columns across by Y Rows down by dividing the width by X and the height by Y.
tiffcrop -S1:2 -e divided very_long_page.tiff fax2page-3.tiff
Running tiffinfo on the output should show two images at roughly half the height in each case.
I assume that what you really want is the functionality off the -P papersize option which breaks the image into N number of smaller images that do not exceed a given papersize. Unfortunately, your fax doesn't match any standard paper size that I know about. The width, which must be calculated at the horizontal resolution is 8.52 inches and the height is 11.21 inches.
tiffcrop -P a4 -e divided produces multiple pages, two of which are very narrow, one very short, one very short and narrow in addition to the desired main pages.
It might not take but a few lines of code to add an option for a custom page size to specified on the command line, eg tiffcrop -U in -P8.52x11.21 which would break the long image into a series of images not wider or longer than those dimenions regardless of how many pages that is. Let me know if that would be useful.
Your image is a fax in Group3 format and the horizontal and vertical resolutions do not match. This may or may not have an impact on the tiff2ps command.
TIFF Directory at offset 0x2affa (176122)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1728 Image Length: 4396
Resolution: 203, 196 pixels/inch
Compression Scheme: CCITT Group 3