2004.05.07 16:37 "[Tiff] Tiff questions", by James Carroll

2004.05.10 18:56 "Re: [Tiff] Tiff questions", by Frank Warmerdam

I am exploring using TIFF support for my image server that also supports FlashPIX. The general idea is that the images are very large, and people want to zoom in and out, so I am trying (pyramidal) multiple levels of downsampled versions of the same image, all stored as jpeg-compressed tiles.

I notice Adobe Photoshop can save a pyramidal TIFF, but when I do so, then look at it with tiffinfo, I don't see multiple pages, or tiles. It seems to be one large image. The file size is 4x what the image would be normally, so something extra is stored somewhere. Normally the image pyramid makes the file 1.33x bigger (not 4x.) Something tells me this isn't going to help me.

Jim,

I can't answer what Photoshop is doing. Are you saying there is no difference in the tiffinfo output before and after building pyramids but the result file is 4x larger? Thats pretty odd.

Can anyone point me to the details of the Photoshop Pyramidal format?

I've got a small test program using libtiff that I'm using to test writing tiled tiffs, and it fails. I get a strange return code from the write, but haven't found a reference of what the return values mean. I notice there's an TIFFErrorHandler callback I can register, but I can't find any examples or specifics of how to do this. Maybe this would tell me what I'm doing wrong.

static void
unixErrorHandler(const char* module, const char* fmt, va_list ap)
{
        if (module != NULL)
                fprintf(stderr, "%s: ", module);
        vfprintf(stderr, fmt, ap);
        fprintf(stderr, ".\n");
}

...
      TIFFSetErrorHandler( UnixErrorHandler );
...

The "va_list ap" is the generic variable arguments stuff used by printf and so on.

How do I make sense of the return codes when writes fail using libtiff?

I think you need to look at the various functions to see what the return codes mean. For example the TIFFSetField() has the following return values:

RETURN VALUES
        1 is returned if the operation was successful. Otherwise, 0 is
        returned if an error was detected.

When I write tiff tiles, there are parameters for x, y, and z. Does the Z parameter correspond to different pages in a multi-tiff or is it a different mechanism?

No, the "Z" is not a page value. It is some sort of third dimension but I have never used it. But it is very distinct from the page file handling.

(Please CC: jim@microbrightfield.com, I'm trying to subscribe, but my subscrption is deferred for approval.)

Now approved. Sorry for the delay.

I would note that there is code related to overviews in the libtiff/contrib/addtiffo directory. It includes a utility to build overviews (as seperate pages with the ReducedResolution bit set). My GDAL library takes advantage of overviews for faster display of data in some circumstances. (http://gdal.maptools.org). I can provide sample files, and inspect pyramid files you produce if you would like. You can even download a built kit for Windows that you can use to prepare/check pyramided files. Let me know (directly) if you need details.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent