TIFF and LibTiff Mail List Archive


1994.06.23 21:03 "Think C Libtiff ???", by David W. Leland
1994.06.24 11:08 "Re: Think C Libtiff ???", by Niles Ritter
1994.06.24 18:23 "Re: Think C Libtiff ???", by Dan McCoy
1994.06.24 13:45 "Re: Think C Libtiff ???", by Niles Ritter

1994.06.24 13:45 "Re: Think C Libtiff ???", by Niles Ritter

static arrays?

We use the libtiff 3.3 tif_lzw.c unchanged, it works with Think 5,6,7,...

Actually, you are right; the libtiff code will compile fine with Symantec C; I now realize the changes I had to make were because the *MPW* compiler gags on any structure definition whose physical size is > 32K (even with 32-bit everything).

tif_lzw.c hasn't had any static arrays since libtiff 3.0,

You are right; this is the MPW-offending structure:

  typedef struct {
          LZWState base;
          long    dec_nbitsmask;          /* lzw_nbits 1 bits, right adjusted */
          long    dec_restart;            /* restart count */
          long    dec_bitsleft;           /* available bits in raw data */
          decodeFunc dec_decode;          /* regular or backwards compatible */
          code_t  *dec_codep;             /* current recognized code */
          code_t  *dec_oldcodep;          /* previously recognized code */
          code_t  *dec_free_entp;         /* next free entry */
          code_t  *dec_maxcodep;          /* max available entry */
          code_t  dec_codetab[CSIZE];
  } LZWDecodeState;

The "dec_codetab[CSIZE]" array is what screws up MPW; my modification changes this to a pointer, which is dynamically allocated.

The mac-tiffinfo sounds like it might be a good addition to the library tools. I'm always having to tell the mac users to move their problem tiff files over to a unix box so I can look at them and tell them what's wrong.

It's not that much more "maclike"; I just added the console support. It just brings up the "commandline" dialog box into which the usual unix- flavored command is put, and the output is either displayed or dumped to a text file.