1
2 Tcl/Tk Image formats (TkImg)
3 (Version 1.4 / January 2009)
4
5 Jan Nijtmans, Andreas Kupries
6
7This file contains a collection of format handlers for the Tk photo
8image type, and a new image type, pixmaps. It can be used in
9combination with Tcl/Tk 8.3 or later but 8.5.6 (or 8.6, when
10available) are highly recommended.
11
12Included in this distribution are the most recent versions (as of
13jan 2009) of the libz, libpng, libungif, libjpeg, and libtiff
14libraries. These are not required, unless you need support for the
15PNG, JPEG, or TIFF format. Note that you have to build these libraries
16to support the named formats, even if your system already has shared
17libraries for these formats. This is because the libraries here are
18built such that they can be loaded as packages by the Tcl/Tk core,
19making the handling of the various dependencies much easier. An earlier
20version, 1.2.4, used a modified copy of Tcl's functions for loading of
21shared libraries to load the support libraries at runtime. These have
22been abandoned in favor of the new approach.
23
24BACKGROUND TO BUILDING
25
26The TkImg sources have been heavily refactored. Instead of building
27one big package there are several small packages most of which are
28independent of each other.
29
30All packages employ a TEA 2 based build system (configure/Make) for
31easy configuration and building. This means that 99% of the options to
32configure are the same for all the packages.
33
34All packages save for the supporting ones (see below) have names
35starting with 'img'. For compatibility with older scripts the
36package index file of the utility package 'img::base' declares
37pseudo-packages 'img' and 'Img' which load all packages provided
38by this extension.
39
40BUILDING - The convenient way
41
42The toplevel directory of tkImg contains a configure and Makefile for
43convenient configuration and building of all packages in the
44extension.
45
46Run this configure script in a build directory of your choice to
47configure all packages, then run
48
49 make all
50 make install
51
52in the build directory. The most important options for configure are
53--prefix and --exec-prefix which tell the build system where to find
54Tcl and Tk, and also where to install the results of the builds
55(header, shared libraries, ...).
56
57This convenient build installs all shared libraries in a single
58directory 'Img<VERSION>, together with a union package index for all
59packages.
60
61If the builder requires only a subset of the packages he can use
62
63 make all
64
65to build all packages, but must not use 'make install' in the top
66build directory. Instead run
67
68 make install
69
70in the sub directories of the build directory which contain the
71requested packages, and their dependencies !
72
73PACKAGES AND THEIR DEPENDENCIES
74
75This section is for people who want to bypass the master
76configure/Makefile.
77
78At the bottom of the hierarchy of dependencies are the 'support
79packages'. They encapsulate the support libraries for ZIP, TIFF, PNG
80and JPEG in packages directly loadable by Tcl. They provide the
81functionality of their underlying libraries via stub-tables. The names
82of these packages are:
83
84 Name Directory Dependency
85 -------------------------------------------------
86 zlibtcl tkimg/compat/libz
87 pngtcl tkimg/compat/libpng zlibtcl
88 jpegtcl tkimg/compat/libjpeg
89 tifftcl tkimg/compat/libtiff
90 -------------------------------------------------
91
92The package 'pngtcl' depends on 'zlibtcl' and has to be built after
93it. Beyond that the order of building is free. Their TEA build systems
94can be found in the directories listed above.
95
96The configure/Makefile's in the directories
97
98 tkimg/compat/libz, tkimg/compat/libpng, tkimg/compat/libjpeg, tkimg/compat/libtiff
99
100must _not_ be used directly under any circumstances.
101
102
103At the next level is the package 'tkimg'. It provides utility
104functions used by all format handlers, and therefore has to be built
105before any of them. Its TEA build system can be found in the directory
106
107 Name Directory Dependency
108 -------------------------------------------------
109 img::base tkimg/base
110 -------------------------------------------------
111
112Beyond that are the packages providing the various format
113handlers. They can be built in any order. Some of them depend on
114supporting packages, as noted below. Their names and directories are
115
116 Name Directory Dependency
117 -------------------------------------------------
118 img::bmp tkimg/bmp
119 img::dted tkimg/dted
120 img::gif tkimg/gif
121 img::ico tkimg/ico
122 img::jpeg tkimg/jpeg jpegtcl
123 img::pcx tkimg/pcx
124 img::pixmap tkimg/pixmap
125 img::png tkimg/png pngtcl, zlibtcl
126 img::ppm tkimg/ppm
127 img::ps tkimg/ps
128 img::raw tkimg/raw
129 img::sgi tkimg/sgi
130 img::sun tkimg/sun
131 img::tga tkimg/tga
132 img::tiff tkimg/tiff tifftcl, zlibtcl, jpegtcl
133 img::window tkimg/window
134 img::xbm tkimg/xbm
135 img::xpm tkimg/xpm
136 -------------------------------------------------
137
138CONFIGURE
139
140The source distributions have "configure", which has the following
141possibilities:
142 configure ?options?
143
144Some possible options:
145 --prefix=<dir> Install headers in <dir>/include.
146 Default: "/usr/local"
147 --exec-prefix=<dir> Install libraries in <dir>/lib.
148 Default: "${prefix}"
149 --with-tcl=<dir> Find Tcl libraries in <dir> and include files in
150 <dir>/../include or <dir>/../generic.
151 Default: "${exec-prefix}/lib" or a sibling directory
152 of the Img build directory.
153 --with-tk=<dir> Find Tk libraries in <dir> and include files in
154 <dir>/../include or <dir>/../generic.
155 Default: the same values as given by --with-tcl
156 or a sibling directory of the Img build directory.
157
158 Packages dependent on one or more of the support packages have
159 appropriate options to locate their libraries and headers, if
160 they cannot be found via --prefix and --exec-prefix
161
162 Use configure --help to query each configure for the full set
163 of options available to it.
164
165
166MAKE & INSTALL
167
168 'make', or 'make all' will build any package.
169
170 'make install' will install its headers and libraries in the
171 directories specified via --prefix/include and --exec-prefix/lib.
172
173USE
174
175If you want to use one or more of new image formats to be available in
176your own scripts, add a line like the following somewhere in your
177script:
178
179 package require img::FORMAT
180
181where FORMAT stands for the name of the format requested. See the list
182in section 'PACKAGES AND THEIR DEPENDENCIES' for the available
183formats. Each format will automatically load all of the packages it is
184dependent on.
185
186The line
187 package require Img
188
189is still legal and will load all format handlers provided by this
190extension except dted and raw.
191
192As an example, have a look at the file "demo.tcl"
193
194For further options see the manpages.
195
196
197DOCUMENTATION
198
199The documentation coming with the distribution is written in the
200doctools format (see tcllib).
201
202 NOTE:
203 The Img documentation makes use of features (include
204 files and variables) which are not part of an official
205 tcllib release yet. A cvs snapshot of tcllib is
206 required.
207
208
209
210PLATFORMS
211 tested:
212 Linux 2.0.30 (gcc, egcs)
213 IRIX 6.2 (cc, 32 bits only)
214 ULTRIX 4.1 (cc, gcc, egcs)
215 ULTRIX 4.4 (cc 3.0)
216 HP-UX-9 (cc, gcc, egcs)
217 HP-UX-10.2 (gcc, egcs)
218 SunOS-4.1.2 (cc)
219 Solaris 2.5 (gcc, egcs)
220 FreeBSD 2.2 (gcc, egcs)
221 Windows 95/98/NT(gcc-2.95/MS Visual C++ 4.2/5.0/6.0)
222
223 Not done yet:
224 Mac ) someone interested
225 VMS ) to try??????
226
227 Other machines and OS's should work too.
228
229Feedback about other OS's and compilers is appreciated. Please
230help me in making this package better.
231
232--
233 Jan Nijtmans
234 email: nijtmans@users.sourceforge.net
235 url: http://purl.oclc.org/net/nijtmans/
236
237 Andreas Kupries, ActiveState Corp
238 email: andreas_kupries@users.sourceforge.net (private)
239 akupries@shaw.ca (private)
240 andreask@activestate.com (work)
241 url: http://www.purl.org/NET/akupries/
242