]> git.imager.perl.org - imager.git/blame - README
extra files from separate PNG
[imager.git] / README
CommitLineData
02d1d628 1================================================================
2a7024e9 2Copyright (c) 1999-2004 Arnar M. Hrafnkelsson. All rights reserved.
f9a39263 3Copyright (c) 2004-2009 Anthony Cook.
02d1d628
AMH
4This program is free software; you can redistribute it and/or
5modify it under the same terms as Perl itself.
6================================================================
7
8>> THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY WHATSOEVER <<
d5d8322f
TC
9
10If you like or hate Imager, please let me know by sending mail
11to imager@imager.perl.org - I love feedback.
02d1d628
AMH
12
13================================================================
14
15
16========================
171. Patent infringements?
18========================
19
20Imager as such contains no patented algorithms. The external
21libraries (which are not written by me) may or may not contain
22patented algorithms. YOU ARE SOLELY RESPONSIBLE FOR OBTAINING
23LICENSE(S) TO USE SUCH LIBRARIES SHOULD YOU NEED ANY.
24
25
26========================
272. Compiling and testing
28========================
29
30Some care has been taken to make the installation as smooth as
31possible. This is rather hard due to the difference between operating
32systems and site setups. To get started just type
33
34$ perl Makefile.PL
35
36It should blurb out a list of which libraries were found and which
37not. If you add a library to the machine after installing Imager it
38does not automatically become available in Imager. It only uses the
39libraries that are found. If the list of found libraries is not what
40you expected, then the Makefile.PL is either not searching in the
41right directories or your box does not have the libraries you think it
42does. For a list of where to get the libraries have a look at
433. External dependencies. To widen the search path for libraries and
44include files set the IM_INCPATH and IM_LIBPATH variables. The
45environment variables that matter when Makefile.PL is run are
46
47IM_INCPATH colon separated list of paths to extra include files
48IM_LIBPATH colon separated list of paths to extra library files
49
50IM_VERBOSE turns on verbose mode for the library scanning and such
51IM_MANUAL to manually select which libraries are used and which not
52IM_NOLOG if true logging will not be compiled into the module
53IM_DEBUG_MALLOC if true malloc debugging will be compiled into the module
54 do not use IM_DEBUG_MALLOC in production - this slows
55 everything down
56
57IM_CFLAGS Extra flags to pass to the compiler
58IM_LFLAGS Extra flags to pass to the linker
59IM_DFLAGS Extra flags to pass to the preprocessor
60
61
62
63When finding the libraries has been sorted out it's time for
64
65$ make
66
67and if that works then do
68
69$ make test
70
71If either fails do take a peek at the file errep.perl. It's creates a
72file report.txt. This is some information which will help me discover
73where the problem is so I can try to fix it in future releases. If
74you find running it ok (just remember - no warranty!) please send the
e8910022 75report.txt via email to imager@imager.perl.org.
02d1d628
AMH
76
77Troubleshooting tips:
78
79A common problem is that libgif/libungif are sometimes linked to the X
80libraries and then running the tests fails. In that case something
81like:
82
83$ IM_LFLAGS="-L/usr/X11R6/lib -lX11" perl Makefile.PL
84
85Which simply sets the environment variables for the extra libraries
86to include the X libraries (which we do not use at all, but must
87included since libgif has been linked with it).
88
feba68a3
TC
89Otherwise you could just build giflib without any X11 dependencies:
90
91 # must be a clean tree
09f10e3e 92 cd giflib-4.1.4
feba68a3
TC
93 ./configure --without-x ...
94
02d1d628
AMH
95Also note that libgif has a few bugs: You can run something like
96
e3ddf807 97$ perl -Iblib/lib -Iblib/arch t/t105gif.t
02d1d628
AMH
98
99This way you can see what comments the test script prints out.
e3ddf807 100t/t105gif.t checks for an bug in libgif and prints out a patch
02d1d628
AMH
101if that bug is present, note that this bug only affects the more
102"advanced" features of libgif.
103
48412c20
AMH
104If for some reason you have libungif-devel package installed but
105not libungif on RedHat then you will probably get lots of errors
106like undefined symbol: FreeSavedImages when running make test.
107Install libungif package to fix it.
108
09f10e3e 109Stock libungif 4.1.4 or later seems to fix all of the bugs, if you
0b836ff8
TC
110have a problem that version of linungif (or later), let us know and
111we'll look into it.
48412c20 112
bd8052a6
TC
113Imager needs to have a libtiff version of at least 3.5.5, but you
114should use a later version since some noticable bugs have been fixed.
115
116For now you can either configure Imager manually (by setting the
117IM_MANUAL environment variable to 1, in sh:
02d1d628
AMH
118
119$ IM_MANUAL=1 perl Makefile.PL
120
121and simply say no to tiff support when asked if you want it, the same thing
122can be used to circumvent problems in gifs to get Imager going.
123
02d1d628
AMH
124If it worked just continue with the installation as normally
125(with make install).
126
2a7024e9
TC
127Freetype 1.x vs Freetype 2.x
128----------------------------
129
130These two libraries have some conflicting include file names, but as
131long as you don't put the Freetype 2.x freetype.h directory in the
132include path it should all work.
133
134Put the directory containing ft2build.h in the include path, but not
135the directory containing the freetype 2.x freetype.h.
136
137If you see compilation errors from font.c you've probably made the
138mistake of putting the Freetype 2.x freetype.h directory into the
139include path.
140
141To see which directories should be in the include path, try:
142
143 freetype-config --cflags
144
a32484c3
TC
145Ideally, freetype-config should be in the PATH when building Imager
146with freetype 2.x support.
147
321d94d4
TC
148
149Macintosh dfont and suitcase font support
150-----------------------------------------
151
152Through Freetype 2.1, Imager can use Macintosh DFON (.dfont) fonts and
153suitcase font files.
154
155If you want to be able to use more than just the first face in the
156font file though, you will need to configure freetype2 with the
157--with-old-mac-fonts option:
158
159 ./configure --with-old-mac-fonts
160
161You can use the index option to get to the other font faces in the
162file:
163
164 # get the second face from $file
165 my $font = Imager::Font->new(file=>$file, index=>1)
166 or die Imager->errstr;
167
168If you're using a suitcase font, you will also need to force the use
169of freetype 2 with the type argument:
170
171 my $font = Imager::Font->new(file=>$suitcase, type=>'ft2', index=>$index)
172 or die Imager->errstr;
173
174
02d1d628
AMH
175========================
1763. External dependencies
177========================
178
179Some hints about getting the Imager module to find the libraries it
f9a39263 180needs for specific features.
02d1d628 181
f9a39263
TC
182Most Linux distributions pre-package these. For each library I've
183listed the Debian and Redhat package names.
31c01e81 184
f9a39263 185For Debian or Debian based system, such as Ubuntu, you would run:
31c01e81 186
f9a39263 187 aptitude install package-name
02d1d628 188
f9a39263
TC
189or:
190
191 apt-get install package-name
192
193at a root shell (or via sudo).
194
195eg.
196
197 apt-get install libjpeg62-dev
198
199For a Redhat based system such as CentOS or Fedora you would run:
200
201 yum install package-name
202
203at a root shell.
204
205eg.
206
207 yum install libjpeg-devel
208
209I strongly recommend using your distribution's packages if possible,
210this will mean any security updates to those packages will be applied
211when you install security updates.
212
2133.1 libjpeg
214-----------
215
216 http://www.ijg.org/files/
217 ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
218
219Provides read and write access to JPEG images.
220
221Make sure you run:
222
223 make install-lib
224
225to install the development headers and libraries before attempting to
226build Imager.
227
228Debian: libjpeg62-dev
229Redhat: libjpeg-devel
230
2313.2 libpng
232----------
233
234 http://www.libpng.org/pub/png/libpng.html
235
236Provides read and write access to PNG images.
237
238You also need zlib to use png: http://www.gzip.org/zlib/ We have
239encountered problems with libpng 1.0.1, which were fixed in 1.0.5
240Note: you should probably be using zlib 1.1.4, since 1.1.3 has a
31c01e81 241potential security problem.
02d1d628 242
f9a39263
TC
243Debian: libpng12-dev
244Redhat: libpng-devel
245
2463.3 giflib
247----------
248
249 http://sourceforge.net/projects/giflib/
250
251Provides read and write access to GIF images.
02d1d628 252
09f10e3e 253giflib/libungif has come a long way since the buggy versions available
31c01e81 254when Imager's gif support code was written. Preferably you should get
09f10e3e 255at least version 4.1.4. If you have a recent Linux distribution you
31c01e81
TC
256should be safe with whatever giflib it provides, but if you're
257building from source, please try to use the latest version.
feba68a3 258
a538a011 259With the expiration of the LZW patent there's no reason to use
f9a39263
TC
260libungif.
261
d5d8322f 262libgif 4.1.4 has no problems known to me at this point.
f1967c11 263
f9a39263
TC
264Debian: libgif-dev
265Redhat: giflib-devel
266
2673.4 libtiff
268-----------
269
270 http://www.remotesensing.org/libtiff/
271
272Provides read and write access to TIFF images.
273
274Note: libtiff 3.9.0 shouldn't be used due to a bug in
275TIFFWriteDirectory().
276
277Debian: libtiff4-dev
278Redhat: libtiff-devel
279
2803.5 T1Lib
281---------
282
283 http://www.t1lib.org/
284 ftp://sunsite.unc.edu/pub/Linux/libs/graphics/
285
286Support for text drawing with Type 1 Postscript fonts.
02d1d628 287
f9a39263
TC
288Debian: libt1-dev
289Redhat: t1lib-devel
02d1d628 290
f9a39263
TC
2913.6 Freetype 2.x (libfreetype)
292------------------------------
293
294 http://www.freetype.org/
295
296Support for text drawing with a large number of font formats,
297including Truetype, Type 1, Opentype and some bitmap formats.
298
299Debian: libfreetype6-dev
300Redhat: freetype-devel
301
3023.7 Freetype 1.x (libttf)
303-------------------------
304
305 http://www.freetype.org/
306
307Support for text drawing with Truetype fonts.
308
309This library has been superceded by Freetype 2, and some Linux
310distributions are phasing it out.
311
312Debian: libttf-dev
313Redhat: freetype1-devel
314
3153.8 Binaries
316------------
02d1d628 317
02d1d628
AMH
318Precompiled versions of some of the libraries might be found at:
319
320AIX:
02d1d628 321
f9a39263
TC
322 http://www.bullfreeware.com/
323
324Solaris:
02d1d628 325
f9a39263 326 http://www.sunfreeware.com/
02d1d628
AMH
327
328========================
3294. Logging and debugging
330========================
331
332Logging is compiled in by default - if you should want to get of it
333from the binaries you can do so by setting the env IMAGER_NOLOG
334to something. If you want to enable malloc debugging to check for leaks
335then set IMAGER_DEBUG_MALLOC to something. Needless to say it is
336pretty pointless to have malloc debug enabled with no logging since you
337can never see the malloc information that way.
338
339
02d1d628 340=================
8f22b8d8 3415. Win32 Support
02d1d628
AMH
342=================
343
344Imager can be installed on Win32 systems. This was ported and tested
faa9b3e7
TC
345with Microsoft Visual C++ 6.0 with build 623 of ActivePerl. You can
346use all of the features of Imager. You can also use Win32 GDI fonts
347directly by supplying the 'face' parameter to Imager::Font->new(...).
348
f9a39263 349I've tested with MSVC++ 6.0, cygwin (perl 5.6.1) and gcc (MinGW).
02d1d628 350
31c01e81
TC
351If you see an error under cygwin during testing along the lines of:
352
353 C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\...some dll to the
354 same address as parent (0x...) != 0x....
355
356you will need to install the cygwin rebase package and run:
357
358 $ rebaseall -v
359
9c271ef0
TC
360If you get errors from your make tool, make sure you're using the same
361make that was used to build your perl - generally GNU make for cygwin,
362nmake for Visual C/C++ and dmake for MinGW.
02d1d628 363
f5bffc46
TC
364Imager and all of the libraries it requires are supplied with
365Strawberry Perl.
366
01b5a039
TC
367============
3686. Mac OS X
369============
370
371Building Imager under OS X is generally straightforward. There are
372some exceptions though:
373
374a) you may find to need to ranlib library files in place after you've
375 installed them, for example:
376
377 ranlib /usr/local/lib/libgif.a
378
379b) the version of GCC enabled by default on OS X 10.4 generates
380 incorrect code for some functions. To work around this run:
381
382 gcc_select 3
383
384 before building Imager and:
385
386 gcc_select 4
387
388 after building Imager.
389
390 This problem exhibits itself as test failures in t/t20fill.t
391
a32484c3
TC
392 Imager 0.56 includes a workaround for this problem, but I wasn't
393 able to test it.
394
01b5a039
TC
395c) if you want to build GCC 4.0 from scratch and use that you will
396 need to adjust the command-line supplied during the link stage, so
397 that there is some other option before the -bundle option.
398
399 For example:
400
401 perl Makefile.PL LDDLFLAGS="`perl -MConfig -e 'print "-g $Config{lddlflags}"'`"
402
02d1d628 403=======================
01b5a039 4047. General information
02d1d628
AMH
405=======================
406
407The Imager module homepage is currently at:
408
31c01e81 409 http://imager.perl.org/
02d1d628 410
f6acebd0 411You can report bugs by pointing your browser at:
e8910022
TC
412
413 https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Imager
02d1d628
AMH
414
415========================
01b5a039 4168. Thanks
02d1d628
AMH
417========================
418
419Thanks go to:
420 Tony Cook ( TonyC )
421 Claes Jacobson ( Claes )
422 Philip Gwyn ( Leolo )
df917a00 423 Michael Slade ( Micksa )
23bf355e 424 ( Cogent )
02d1d628
AMH
425 Brad Murray ( HalfJack )
426 Nicholas Dronen ( Veblen )
427 Michael G Schwern ( Schwern )
428 Rocco Caputo ( Dngor )
429 Graham barr ( Gbarr )
430 Mark-Jason Dominus ( Mjd )
431 Jerome
432 Jason Alexander ( Jalex )
433 Randal R. Schwartz ( Merlyn )
434 Tkil ( )
435 Artur Bergman ( Sky )
436 Luc St-Louis ( Lucs )
437 PerlJam ( )
438 Roderick Schertler ( Roderick )
439 Nathan Torkington ( gnat )
f9a39263 440 Gabriel Vasseur
02d1d628
AMH
441
442(and just to play it safe) all those I forgot to mention.