delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/31/15:17:42

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:content-type:subject:date
:message-id:from:to; q=dns; s=default; b=Dt60lHMZkTMMLxapfvmJeQd
zfwLCxom/4xPTdSHA0qsMc+mWS/MMwsG7PZGTbcerHVGzHWIW5JlK4YxAHlEK0x8
v86YVpRblFFkwuVN2GswD5zbx2zk6/oaWbsbfWwEmOqUXOtC8FrVFIBXCFu2V1r1
cX0/yhMjn3Iz+AwQp/H4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:content-type:subject:date
:message-id:from:to; s=default; bh=Kn+dONDNb7pYQWh85NRSvKeqA4s=; b=
Hhy2AqqMzGOKsrIelA4TUAowsLiFVxuAN0m89ul7mLKGZ43/WCdwD+F09at3Qaar
EQLm0czi2dne5fgfSmEfLtocJOSPYfvpkeiQ7AiDDJlPvHYwmHX5Cr8b2AsozzFn
dlKp/zKRylI/Zi3snowj9ILv69aQ3Th8tcAW+QXRw7s=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.7 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2
X-HELO: exprod5og119.obsmtp.com
MIME-Version: 1.0
Subject: TIFFWriteDirectory() fails on network drive
Date: Fri, 31 Jan 2014 14:17:22 -0600
Message-ID: <9C9CA6EA23F2394D9A524E7F16235E1201017D85@srv1163ex1.flightsafety.com>
From: "Hsu, Justine" <Justine DOT Hsu AT FlightSafety DOT com>
To: <cygwin AT cygwin DOT com>

------_=_NextPart_001_01CF1EC1.73705778
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 fi=
le, even after applying this hotfix http://support.microsoft.com/kb/2732673=
=20
Here is the relevant code:

=A0=A0=A0 =A0=A0=A0=A0const int dim =3D 64;
=A0=A0=A0 =A0=A0=A0=A0const int channels =3D 3;

=A0=A0=A0 =A0=A0=A0=A0TIFF *tif =3D TIFFOpen(argv[1], "w");
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_IMAGEWIDTH,=A0=A0=A0=A0=A0 =
dim);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_IMAGELENGTH,=A0=A0=A0=A0 di=
m);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, channels);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,=A0=A0=A0 1);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE,=A0=A0 8);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_PLANARCONFIG,=A0=A0=A0 1);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_PHOTOMETRIC,=A0=A0=A0=A0 PH=
OTOMETRIC_RGB);
=A0=A0=A0=A0=A0=A0=A0 TIFFSetField(tif, TIFFTAG_COMPRESSION,=A0=A0=A0=A0 CO=
MPRESSION_LZW);
=A0=A0=A0=A0=A0=A0=A0=20
=A0=A0=A0=A0=A0=A0=A0=A0int i;
=A0=A0=A0=A0=A0=A0=A0 for (i =3D 0; i < dim; i++)
=A0=A0=A0=A0=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 TIFFWriteScanline(tif, buf + dim*channels=
*(dim - i - 1), i, 0);
=A0=A0=A0=A0=A0=A0 =A0}

=A0=A0=A0=A0=A0=A0 =A0TIFFWriteDirectory(tif);
=A0=A0=A0=A0=A0=A0=A0 TIFFClose(tif);

Justine

------_=_NextPart_001_01CF1EC1.73705778
Content-Type: application/octet-stream; name="tiff_test.c"
Content-Transfer-Encoding: base64
Content-Description: tiff_test.c
Content-Disposition: attachment; filename="tiff_test.c"

DQojaW5jbHVkZSA8c3RkaW8uaD4NCiNpbmNsdWRlIDx0aWZmaW8uaD4NCg0K
aW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0Kew0KICAgIGlmIChh
cmdjIDw9IDEpDQogICAgew0KICAgICAgICBwcmludGYoIm5lZWQgZmlsZSBu
YW1lXG4iKTsNCiAgICAgICAgcmV0dXJuIDA7DQogICAgfQ0KICAgIA0KICAg
IGNvbnN0IGludCBkaW0gPSA2NDsNCiAgICBjb25zdCBpbnQgY2hhbm5lbHMg
PSAzOw0KICAgIGNvbnN0IGludCBzaXplID0gZGltICogZGltICogY2hhbm5l
bHM7DQogICAgY2hhciAqYnVmID0gbWFsbG9jKHNpemUpOw0KICAgIGludCBp
ID0gMDsNCiAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZTsgaSsrKQ0KICAgICAg
ICBidWZbaV0gPSAnXDAnOw0KICAgIA0KICAgIFRJRkYgKnRpZiA9IFRJRkZP
cGVuKGFyZ3ZbMV0sICJ3Iik7DQogICAgaWYgKHRpZiA9PSBOVUxMKQ0KICAg
ICAgICBwcmludGYoImNhbid0IG9wZW4gZmlsZSB0byB3cml0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AgICBwcmludGYoImVycm9yXG4iKTsNCiAgICAgICAgICAgIA0KICAg
ICAgICBUSUZGQ2xvc2UodGlmKTsNCiAgICB9DQogICAgICAgIA0KICAgIGZy
ZWUoYnVmKTsNCiAgICByZXR1cm4gMDsNCn0NCg==


------_=_NextPart_001_01CF1EC1.73705778
Content-Type: text/plain; charset=us-ascii

--
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
------_=_NextPart_001_01CF1EC1.73705778--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019