183183#include <ctype.h>
184184#include <time.h>
185185
186+ size_t
187+ cbf_TIFFSNPrintDirectory (TIFF * tif , char * str , const size_t xstrlen , long flags );
188+
186189int local_exit (int );
187190
188191int local_exit (int status ) {
@@ -212,9 +215,9 @@ int main (int argc, char *argv [])
212215 TIFF * tif ;
213216 cbf_handle cbf ;
214217 clock_t a ,b ;
215- uint32 width ;
216- uint32 height ;
217- uint32 npixels ;
218+ uint32_t width ;
219+ uint32_t height ;
220+ uint32_t npixels ;
218221 unsigned char * raster ;
219222 char * tiffile ;
220223 char * cbffile ;
@@ -325,7 +328,7 @@ int main (int argc, char *argv [])
325328
326329 a = clock ();
327330
328- if (!(tif = TIFFOpen (tiffile , "r " ))) {
331+ if (!(tif = TIFFOpen (tiffile , "rC " ))) {
329332
330333 fprintf (stderr ,"tiff2cbf: unable to open tiff image %s, abort\n" , tiffile );
331334 local_exit (-1 );
@@ -364,7 +367,7 @@ int main (int argc, char *argv [])
364367 tstrip_t nstrips , strip ;
365368 tsize_t stripsize ;
366369 int elsize , elsign , real , plex , treturn ;
367- uint16 sampleformat , samplesperpixel , bitspersample , planarconfig ;
370+ uint16_t sampleformat , samplesperpixel , bitspersample , planarconfig ;
368371 size_t dimslow , dimmid , dimfast ;
369372
370373 plex = 1 ;
@@ -391,12 +394,12 @@ int main (int argc, char *argv [])
391394 cbf_failnez (cbf_require_column (cbf , "binary_id "))
392395 cbf_failnez (cbf_set_integervalue (cbf , imageno ))
393396 cbf_failnez (cbf_require_column (cbf , "header_contents "))
394- headsize = 1 + TIFFSNPrintDirectory (tif ,buffer ,0 ,TIFFPRINT_COLORMAP |TIFFPRINT_CURVES );
397+ headsize = 1 + cbf_TIFFSNPrintDirectory (tif ,buffer ,0 ,TIFFPRINT_COLORMAP |TIFFPRINT_CURVES );
395398 headstring = (char * ) _TIFFmalloc (headsize );
396399 if (!headstring ) {
397400 cbf_failnez (CBF_ALLOC );
398401 }
399- nheadsize = TIFFSNPrintDirectory (tif ,headstring ,headsize - 1 ,TIFFPRINT_COLORMAP |TIFFPRINT_CURVES );
402+ nheadsize = cbf_TIFFSNPrintDirectory (tif ,headstring ,headsize - 1 ,TIFFPRINT_COLORMAP |TIFFPRINT_CURVES );
400403 if (nheadsize > headsize - 1 ) {
401404 _TIFFfree (headstring );
402405 cbf_failnez (CBF_ALLOC );
0 commit comments