AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

2007.01.11 19:33 "[Tiff] tiffcrop -> geotiffcrop, is it possible?", by Gennady Khokhorin

Frank,

Not long ago tifflib mailing list got a message about new tiffcrop utility. I found it very useful, in my case I need to clip area of interest in aerial photo and store result outside for delivery. I'm wonder if it is possible to reproduce this utility in form of geotiffcrop to keep georeference as well.

One approach would be to handle coordinates in twf world file. But will be much better to update all georef info.

If it is possible I would put request for such command in the wish list.

Thanks,
Gennady

Tiff list readers,

I have a working version of a new utility called tiffcrop that is based on tiffcp. It adds cropping by specifying margins, fixed sized regions, and zones that are portions of the image, ie 1/4, 1/2, etc from a specified reference edge. I've added rotation by 90,180, or 270 degrees and mirroring horizontally or vertically. All of these can be applied to the entire image or just a crop region. I have tested with bilevel, 8 bit grayscale, 8 bit palette, 8 bit RGB, 8 bit RGBA images successfully. The only image that I can't seem to handle is an 8 bit YCbCr with 3 samples per pixel from the libtiff test pics set, dscf0013.tif. Does anyone have any information on how YCbCr images are handled by the read[Separate/Contig][Strips/Tiles]IntoBuffer routines in tiffcp that would be different for YCbCr data rather than RGBA data? Since the source file is too large to send to the Tiff list, I can send the source file or a diff against tiffcp.c to anyone who is interested in testing the code. The source is 96 K and the diff against tiffcp.c in the 3.8.2 distribution is 50 K. Just send me your email address. Richard Nolde

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/