2012.07.29 18:34 "[Tiff] So ... what about exporting TIFFDataSize?", by Tom Lane

2012.07.29 19:17 "Re: [Tiff] So ... what about exporting TIFFDataSize?", by Bob Friesenhahn

Le dimanche 29 juillet 2012 20:34:58, Tom Lane a écrit:

Armed with the accessor functions for TIFFField, I went back for another try at building freeimage with libtiff 4.0, and found there's still a remaining problem: it tries to use _TIFFDataSize() which is no longer accessible from outside the library. Looking at this, it seems like we should export that function or something just like it, because the only alternative is for clients to have built-in knowledge that TIFF_RATIONAL is funny. I see that tiffset.c has effectively duplicated TIFFDataSize() in-line, which is surely even worse.

So, any objections to renaming this to TIFFDataSize() and exporting it? Has anyone got a better naming suggestion than that?

No better suggestion, but due to the fact that the difference between the concepts of Size and Width might not be obvious to the reader, it might be wise to be really explicit in the documentation of how they differ. If I understand well, TIFFDataWidth() is about the size on disk, and TIFFDataSize() the size in memory?

Agreed. This function would be rather poorly named if exported as TIFFDataSize() since the name is suggestive of a great many things, most of which have nothing to do with its purpose. However, a name like TIFFDataTypeSize() suggests a specific purpose, particularly given its TIFFDataType argument.

Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/