This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Jan 31 14:17, Hsu, Justine wrote: > 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); And this question is is Cygwin-related, because...? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat
Attachment:
pgp15DFBJ0tlt.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |