May 24, 1995 This is version 1.0 of the HPL extensions to tk. This distribution contains two extensions which add TIFF and PNM file format handlers to the image photo type. I have only tested these with tcl7.4b3 and tk4.0b3. TIFF -- based on the TIFF6.0 library (tested with v3.3beta015 and v3.4beta004), this format handler offers support for most TIFF files. (support for tiled and multi-resolution files is forthcoming), including all compression modes and palette color. This handler can be explicitly selected using the "-format TIFF" option to the photo command. PNM -- based on the PBMPlus library (tested with the 10dec91 and netpbm-1mar1994 versions), this format handler provides complete support for pbm, pgm, and ppm images. This handler can be explicitly selected using the "-format PNM" option to the photo command. BUILDING A NEW WISH **NOTE**: These format handlers require that you link your wish executable to the publicly available libraries for TIFF and/or PBMPlus. These libraries are NOT included with the HPL extension, but I have included a README file for each which includes installation information. The TIFF extension requires linking with libtiff.a (and libjpeg.a, if your TIFF library includes the JPEG extension), and the PNM extension requires linking with libpbm.a, libpgm.a, libppm.a, and libpnm.a. You will also need to add the include directories for the tiff and pnm include files (tiffio.h and pnm.h, respectively). Finally, be sure to add the calls to Pnm_Init() and/or Tiff_Init(), depending on which handlers you wish to install. The extension files themselves are called hpl_tiff.c and hpl_pnm.c, and there is an example AppInit.c file call hplAppInit.c. IMPLEMENTATION NOTE The tk image photo type only deals with 24-bit data internally. For simplicity, these HPL format handlers promote all input data to 24 bits per pixel. On output, an image is only written as 24-bit, uncompressed data. The tk photo format handler does not have hooks to allow setting driver-dependent options like compression, bit depth, etc.; the tiff library can be used to write compressed formats, but you'll have to write your own non-standard work around to set the tiff compression tag from within tk. Please direct general compilation questions and enhancement requests to the comp.lang.tcl newsgroup, but feel free to send bug reports directly to me. -- Andy ________________________________________________________________________ Andrew Fitzhugh fitzhugh@hpl.hp.com Palo Alto, CA Hewlett-Packard Laboratories