The attached program tries to save a blank 64 x 64 TIFF image to specified path. When the path specified is local, the images saves fine. If the path is on a network drive on a Windows7, then it saves a corrupt file, even after applying this hotfix http://support.microsoft.com/kb/2732673 Here is the relevant code:
const int dim = 64;
const int channels = 3;
TIFF *tif = TIFFOpen(argv[1], "w");
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, dim);
TIFFSetField(tif, TIFFTAG_IMAGELENGTH, dim);
TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, channels);
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, 1);
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
int i;
for (i = 0; i < dim; i++)
{
TIFFWriteScanline(tif, buf + dim*channels*(dim - i - 1), i, 0);
}
TIFFWriteDirectory(tif);
TIFFClose(tif);
Justine
tiff_test.c
Description: tiff_test.c
-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple

