AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2018

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2018.12.11 13:36 "SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.11 14:01 "Re: SeekOK and WriteOK", by Bob Friesenhahn
2018.12.11 14:09 "Re: SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.11 14:24 "Re: SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.11 14:29 "Re: SeekOK and WriteOK", by Nicolas Ruff
2018.12.11 18:54 "Re: SeekOK and WriteOK", by Bob Friesenhahn
2018.12.12 08:53 "Re: SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.13 11:04 "Re: SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.13 13:13 "Re: SeekOK and WriteOK", by Paavo Helde

2018.12.13 11:04 "Re: SeekOK and WriteOK", by Emmanuel Cosnard

Hello,

I found out what the problem was: the buffer size I gave in input of the
WriteOK was larger than the actual size of the buffer.
What I don't understand is how libtiff does to not crash, but only sometimes
return an error (-1), and sometimes, writing the data of the buffer anyway.
Do you have any explanation?

Thank you for your help and regards,

Emmanuel
________________________________
De : Emmanuel Cosnard
Envoyé : mercredi 12 décembre 2018 08:53
À : Bob Friesenhahn; Nicolas RUFF
Cc : tiff@lists.osgeo.org
Objet : RE: [Tiff] SeekOK and WriteOK

I actually noticed that I never get any problem with the SeekOK, but only
with writeOK.
I sometimes returns -1 although he wrote everything I wanted to, and
sometimes returns -1 and doesn't write anything but I have no clue why on
some occasions he doesn't write...


________________________________
De : Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Envoyé : mardi 11 décembre 2018 18:54
À : Nicolas RUFF
Cc : emmanuel.cosnard@outlook.fr; tiff@lists.osgeo.org
Objet : Re: [Tiff] SeekOK and WriteOK

On Tue, 11 Dec 2018, Nicolas RUFF wrote:

> This might be by design of the API :)
> http://bugzilla.maptools.org/show_bug.cgi?id=2726
>
> lseek() returns -1 in both cases:
> - lseek(-1, SEEK_SET)
> - An error occurred
>
> You have to clear then check errno to distinguish between cases.

One approach is to call 'lseek(fd,SEEK_CUR)' and verify that the
return value is the expected offset.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt


_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff