AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
October 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.10.14 18:00 "debugging on Windows", by Rajmohan Banavi
2008.10.14 23:15 "Re: debugging on Windows", by Bob Friesenhahn
2008.10.15 04:36 "Re: debugging on Windows", by Rajmohan Banavi

2008.10.14 18:00 "debugging on Windows", by Rajmohan Banavi

Hi,
Just started using libtiff 3.8.2 on Windows (gnuwin32.sourceforge.net) and
am seeing an unhandled exception when I call the api - TIFFPrintDirectory().
I have pasted the code below. Even if I provide stdout as the 2nd parameter
to the function TIFFPrintDirectory(), i see the same crash. Please let me
know what I am missing. Further, just wanted to know how easy is it to build
a debug version of the libs for Windows?

Thanks.

------------------------------------------------------------------------------------------------------------------------------------------------------
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>

#include "tiffio.h"

int main(int argc, char* argv[])
{
    TIFF *image;
    uint32 width, height, pages = 0;
    uint32 *raster = NULL;
    tsize_t stripSize;
    FILE *tiffinfo;

    /* open the TIFF image */
    if ((image = TIFFOpen("test.TIF", "r")) == NULL)
    {
        fprintf(stderr, "Could not open the input file\n");
        printf ("You never come here\n");
        exit(42);
    }

    tiffinfo = fopen ("tiffinfo.txt", "w");
    if (tiffinfo == NULL)
    {
        fprintf(stderr, "Could not open the tiff info output file\n");
    }

    do
    {
        pages++;

        /* Find the height and the width of the given image */
        TIFFGetField(image, TIFFTAG_IMAGEWIDTH, &width);
        TIFFGetField(image, TIFFTAG_IMAGELENGTH, &height);

        printf ("Image Height: %d and width: %d\n", height, width);

        TIFFPrintDirectory(image, tiffinfo, TIFFPRINT_NONE);
    } while (TIFFReadDirectory(image));

    printf ("Number of pages: %d\n", pages);

    TIFFClose(image);
    fclose(tiffinfo);

    return 0;
}