]> git.imager.perl.org - imager.git/blob - README
57bfc25df4b1fba2dd4141ff11a6cd636b85d953
[imager.git] / README
1 ================================================================
2 Copyright (c) 1999-2004 Arnar M. Hrafnkelsson. All rights reserved.
3 Copyright (c) 2004 Anthony Cook.
4 This program is free software; you can redistribute it and/or
5 modify it under the same terms as Perl itself.
6 ================================================================
7
8 >> THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY WHATSOEVER <<
9 If you like or hate Imager, please let us know by sending mail 
10 to imager@imager.perl.org
11
12 ================================================================
13
14
15 ========================
16 1. Patent infringements?
17 ========================
18
19 Imager as such contains no patented algorithms.  The external
20 libraries (which are not written by me) may or may not contain
21 patented algorithms.  YOU ARE SOLELY RESPONSIBLE FOR OBTAINING
22 LICENSE(S) TO USE SUCH LIBRARIES SHOULD YOU NEED ANY.
23
24
25 ========================
26 2. Compiling and testing
27 ========================
28
29 Some care has been taken to make the installation as smooth as
30 possible.  This is rather hard due to the difference between operating
31 systems and site setups.  To get started just type
32
33 $ perl Makefile.PL
34
35 It should blurb out a list of which libraries were found and which
36 not.  If you add a library to the machine after installing Imager it
37 does not automatically become available in Imager.  It only uses the
38 libraries that are found.  If the list of found libraries is not what
39 you expected, then the Makefile.PL is either not searching in the
40 right directories or your box does not have the libraries you think it
41 does.  For a list of where to get the libraries have a look at
42 3. External dependencies.  To widen the search path for libraries and
43 include files set the IM_INCPATH and IM_LIBPATH variables.  The
44 environment variables that matter when Makefile.PL is run are
45
46 IM_INCPATH      colon separated list of paths to extra include files
47 IM_LIBPATH      colon separated list of paths to extra library files
48
49 IM_VERBOSE      turns on verbose mode for the library scanning and such
50 IM_MANUAL       to manually select which libraries are used and which not
51 IM_NOLOG        if true logging will not be compiled into the module
52 IM_DEBUG_MALLOC if true malloc debugging will be compiled into the module
53                 do not use IM_DEBUG_MALLOC in production - this slows
54                 everything down
55
56 IM_CFLAGS       Extra flags to pass to the compiler
57 IM_LFLAGS       Extra flags to pass to the linker
58 IM_DFLAGS       Extra flags to pass to the preprocessor
59
60
61
62 When finding the libraries has been sorted out it's time for
63
64 $ make 
65
66 and if that works then do
67
68 $ make test
69
70 If either fails do take a peek at the file errep.perl.  It's creates a
71 file report.txt.  This is some information which will help me discover
72 where the problem is so I can try to fix it in future releases.  If
73 you find running it ok (just remember - no warranty!) please send the
74 report.txt via email to imager@imager.perl.org.
75
76 Troubleshooting tips:
77
78 A common problem is that libgif/libungif are sometimes linked to the X
79 libraries and then running the tests fails.  In that case something
80 like:
81
82 $ IM_LFLAGS="-L/usr/X11R6/lib -lX11" perl Makefile.PL
83
84 Which simply sets the environment variables for the extra libraries 
85 to include the X libraries (which we do not use at all, but must
86 included since libgif has been linked with it).
87
88 Otherwise you could just build giflib without any X11 dependencies:
89
90   # must be a clean tree
91   cd giflib-4.1.3
92   ./configure --without-x ...
93
94 Also note that libgif has a few bugs: You can run something like
95
96 $ perl -Iblib/lib -Iblib/arch t/t105gif.t
97
98 This way you can see what comments the test script prints out.
99 t/t105gif.t checks for an bug in libgif and prints out a patch
100 if that bug is present, note that this bug only affects the more
101 "advanced" features of libgif.
102
103 If for some reason you have libungif-devel package installed but
104 not libungif on RedHat then you will probably get lots of errors
105 like undefined symbol: FreeSavedImages when running make test.
106 Install libungif package to fix it.
107
108 Stock libungif 4.1.2 or later seems to fix all of the bugs, if you
109 have a problem that version of linungif (or later), let us know and
110 we'll look into it.
111
112 Imager needs to have a libtiff version of at least 3.5.5.  In the
113 future we might consider supporting older libtiff versions.  For
114 now you can either configure Imager manually (by
115 setting the IM_MANUAL environment variable to 1, in sh:
116
117 $ IM_MANUAL=1 perl Makefile.PL
118
119 and simply say no to tiff support when asked if you want it, the same thing
120 can be used to circumvent problems in gifs to get Imager going.
121
122 If it worked just continue with the installation as normally 
123 (with make install).
124
125 Freetype 1.x vs Freetype 2.x
126 ----------------------------
127
128 These two libraries have some conflicting include file names, but as
129 long as you don't put the Freetype 2.x freetype.h directory in the
130 include path it should all work.
131
132 Put the directory containing ft2build.h in the include path, but not
133 the directory containing the freetype 2.x freetype.h.
134
135 If you see compilation errors from font.c you've probably made the
136 mistake of putting the Freetype 2.x freetype.h directory into the
137 include path.
138
139 To see which directories should be in the include path, try:
140
141   freetype-config --cflags
142
143
144 Macintosh dfont and suitcase font support
145 -----------------------------------------
146
147 Through Freetype 2.1, Imager can use Macintosh DFON (.dfont) fonts and
148 suitcase font files.
149
150 If you want to be able to use more than just the first face in the
151 font file though, you will need to configure freetype2 with the
152 --with-old-mac-fonts option:
153
154   ./configure --with-old-mac-fonts
155
156 You can use the index option to get to the other font faces in the
157 file:
158
159   # get the second face from $file
160   my $font = Imager::Font->new(file=>$file, index=>1)
161     or die Imager->errstr;
162
163 If you're using a suitcase font, you will also need to force the use
164 of freetype 2 with the type argument:
165
166   my $font = Imager::Font->new(file=>$suitcase, type=>'ft2', index=>$index)
167     or die Imager->errstr;
168
169
170 ========================
171 3. External dependencies
172 ========================
173
174 Some hints about getting the Imager module to find the libraries it
175 needs for specific features.  The libraries it uses are:
176
177  jpeg: http://www.ijg.org/files/
178        ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
179
180 ftp.uu.net is still linked from many places, including the Independent
181 JPEG Groups's home page, but it is non-functional.
182
183   png: http://www.libpng.org/pub/png/libpng.html
184
185   you also need zlib to use png:  http://www.gzip.org/zlib/
186 We have encountered problems with libpng 1.0.1, which were fixed in 1.0.5
187 Note: you should probably be using zlib 1.1.4, since 1.1.3 has a 
188 potential security problem.
189
190   gif: http://sourceforge.net/projects/libungif
191
192 giflib/libungif has come a long way since the buggy versions around
193 when Imager's gif support code was written.  Preferably you should get
194 at least version 4.1.3.  If you have a recent Linux distribution you
195 should be safe with whatever giflib it provides, but if you're
196 building from source, please try to use the latest version.
197
198 If you download giflib (as opposed to libungif) 4.1.3 from
199 sourceforge, make sure you apply the patch referenced at:
200
201 https://sourceforge.net/tracker/index.php?func=detail&aid=981255&group_id=102202&atid=631306
202
203 libungif 4.1.3 does not need this patch.
204
205 At the time of writing you will need to manually select to install the
206 4.1.2-1 of cygwin's libungif package.
207
208  tiff: http://www.libtiff.org/
209
210    t1: http://www.ibiblio.org/pub/Linux/libs/graphics/
211
212 freetype2 or
213    tt: http://www.freetype.org/
214
215 Precompiled versions of some of the libraries might be found at:
216
217 AIX:
218    http://www.bullfreeware.com/
219
220
221
222 ========================
223 4. Logging and debugging
224 ========================
225
226 Logging is compiled in by default - if you should want to get of it
227 from the binaries you can do so by setting the env IMAGER_NOLOG 
228 to something. If you want to enable malloc debugging to check for leaks
229 then set IMAGER_DEBUG_MALLOC to something.  Needless to say it is
230 pretty pointless to have malloc debug enabled with no logging since you 
231 can never see the malloc information that way.
232
233
234 =================
235 5. Win32 Support
236 =================
237
238 Imager can be installed on Win32 systems.  This was ported and tested
239 with Microsoft Visual C++ 6.0 with build 623 of ActivePerl.  You can
240 use all of the features of Imager.  You can also use Win32 GDI fonts
241 directly by supplying the 'face' parameter to Imager::Font->new(...).
242
243 I've tested with both MSVC++ 6.0 and cygwin (perl 5.6.1).
244
245 If you see an error under cygwin during testing along the lines of:
246
247   C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\...some dll to the 
248     same address as parent (0x...) != 0x....
249
250 you will need to install the cygwin rebase package and run:
251
252   $ rebaseall -v
253
254 Under cygwin you will need at least libungif 4.1.2 installed to
255 prevent lockups in the gif test scripts.  At the time of writing you
256 need to select libungif-4.1.2-1 manually in the setup.exe installation
257 tool.
258
259 If you have any problems with the Win32 support, please email
260 imager@imager.perl.org (don't forget to use nmake instead of make).
261
262 =======================
263 6. General information
264 =======================
265
266 The Imager module homepage is currently at:
267
268  http://imager.perl.org/
269
270 The current docs are rather bad as I've been busy adding features
271 but hopefully they will be updated soon.  Until then you'll just
272 have to use the source. The test scripts might also be a good idea.
273 By activating the the #init_log lines in the test script you can get
274 rather verbose debugging output from the C code.
275
276 You can report bugs either by sending email to:
277
278   bug-Imager@rt.cpan.org
279
280 or by pointing your browser at:
281
282   https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Imager
283
284 ========================
285 7. Thanks
286 ========================
287
288 Thanks go to:
289   Tony Cook           ( TonyC )
290   Claes Jacobson      ( Claes )
291   Philip Gwyn         ( Leolo )
292   Michael Slade       ( Micksa )
293                       ( Cogent )
294   Brad Murray         ( HalfJack )
295   Nicholas Dronen     ( Veblen )
296   Michael G Schwern   ( Schwern )
297   Rocco Caputo        ( Dngor )
298   Graham barr         ( Gbarr )
299   Mark-Jason Dominus  ( Mjd )
300   Jerome
301   Jason Alexander     ( Jalex )
302   Randal R. Schwartz  ( Merlyn )
303   Tkil                ( )
304   Artur Bergman       ( Sky )
305   Luc St-Louis        ( Lucs )
306   PerlJam             ( )
307   Roderick Schertler  ( Roderick )
308   Nathan Torkington   ( gnat )
309
310 (and just to play it safe) all those I forgot to mention.