1 ================================================================
2 Copyright (c) 1999-2004 Arnar M. Hrafnkelsson. All rights reserved.
3 Copyright (c) 2004-2011 Anthony Cook.
4 This program is free software; you can redistribute it and/or
5 modify it under the same terms as Perl itself.
7 A test font, FT2/fontfiles/MMOne.pfb contains Postscript code
8 copyrighted by Adobe. See adobe.txt for license information.
9 ================================================================
11 >> THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY WHATSOEVER <<
13 If you like or hate Imager, please let me know by sending mail
14 to tonyc@cpan.org - I love feedback.
16 ================================================================
19 ========================
20 1. Patent infringements?
21 ========================
23 Imager as such contains no patented algorithms. The external
24 libraries (which are not written by me) may or may not contain
25 patented algorithms. YOU ARE SOLELY RESPONSIBLE FOR OBTAINING
26 LICENSE(S) TO USE SUCH LIBRARIES SHOULD YOU NEED ANY.
29 ========================
30 2. Compiling and testing
31 ========================
33 Some care has been taken to make the installation as smooth as
34 possible. This is rather hard due to the difference between operating
35 systems and site setups. To get started just type
39 It should blurb out a list of which libraries were found and which
40 not. If you add a library to the machine after installing Imager it
41 does not automatically become available in Imager. It only uses the
42 libraries that are found. If the list of found libraries is not what
43 you expected, then the Makefile.PL is either not searching in the
44 right directories or your box does not have the libraries you think it
45 does. For a list of where to get the libraries have a look at
46 3. External dependencies. To widen the search path for libraries and
47 include files set the IM_INCPATH and IM_LIBPATH variables. The
48 environment variables that matter when Makefile.PL is run are
50 IM_INCPATH colon separated list of paths to extra include files
51 IM_LIBPATH colon separated list of paths to extra library files
53 IM_VERBOSE turns on verbose mode for the library scanning and such
54 IM_MANUAL to manually select which libraries are used and which not
55 IM_NOLOG if true logging will not be compiled into the module
56 IM_DEBUG_MALLOC if true malloc debugging will be compiled into the module
57 do not use IM_DEBUG_MALLOC in production - this slows
60 IM_CFLAGS Extra flags to pass to the compiler
61 IM_LFLAGS Extra flags to pass to the linker
62 IM_DFLAGS Extra flags to pass to the preprocessor
66 When finding the libraries has been sorted out it's time for
70 and if that works then do
74 If either fails do take a peek at the file errep.perl. It's creates a
75 file report.txt. This is some information which will help me discover
76 where the problem is so I can try to fix it in future releases. If
77 you find running it ok (just remember - no warranty!) please send the
78 report.txt via email to tonyc@cpan.org.
82 A common problem is that libgif/libungif are sometimes linked to the X
83 libraries and then running the tests fails. In that case something
86 $ IM_LFLAGS="-L/usr/X11R6/lib -lX11" perl Makefile.PL
88 Which simply sets the environment variables for the extra libraries
89 to include the X libraries (which we do not use at all, but must
90 included since libgif has been linked with it).
92 Otherwise you could just build giflib without any X11 dependencies:
94 # must be a clean tree
96 ./configure --without-x ...
98 Also note that libgif has a few bugs: You can run something like
100 $ perl -Iblib/lib -Iblib/arch t/t105gif.t
102 This way you can see what comments the test script prints out.
103 t/t105gif.t checks for an bug in libgif and prints out a patch
104 if that bug is present, note that this bug only affects the more
105 "advanced" features of libgif.
107 If for some reason you have libungif-devel package installed but
108 not libungif on RedHat then you will probably get lots of errors
109 like undefined symbol: FreeSavedImages when running make test.
110 Install libungif package to fix it.
112 Stock libungif 4.1.4 or later seems to fix all of the bugs, if you
113 have a problem that version of linungif (or later), let us know and
116 Imager needs to have a libtiff version of at least 3.5.5, but you
117 should use a later version since some noticable bugs have been fixed.
119 For now you can either configure Imager manually (by setting the
120 IM_MANUAL environment variable to 1, in sh:
122 $ IM_MANUAL=1 perl Makefile.PL
124 and simply say no to tiff support when asked if you want it, the same thing
125 can be used to circumvent problems in gifs to get Imager going.
127 If it worked just continue with the installation as normally
130 Freetype 1.x vs Freetype 2.x
131 ----------------------------
133 These two libraries have some conflicting include file names, but as
134 long as you don't put the Freetype 2.x freetype.h directory in the
135 include path it should all work.
137 Put the directory containing ft2build.h in the include path, but not
138 the directory containing the freetype 2.x freetype.h.
140 If you see compilation errors from font.c you've probably made the
141 mistake of putting the Freetype 2.x freetype.h directory into the
144 To see which directories should be in the include path, try:
146 freetype-config --cflags
148 Ideally, freetype-config should be in the PATH when building Imager
149 with freetype 2.x support.
152 Macintosh dfont and suitcase font support
153 -----------------------------------------
155 Through Freetype 2.1, Imager can use Macintosh DFON (.dfont) fonts and
158 If you want to be able to use more than just the first face in the
159 font file though, you will need to configure freetype2 with the
160 --with-old-mac-fonts option:
162 ./configure --with-old-mac-fonts
164 You can use the index option to get to the other font faces in the
167 # get the second face from $file
168 my $font = Imager::Font->new(file=>$file, index=>1)
169 or die Imager->errstr;
171 If you're using a suitcase font, you will also need to force the use
172 of freetype 2 with the type argument:
174 my $font = Imager::Font->new(file=>$suitcase, type=>'ft2', index=>$index)
175 or die Imager->errstr;
178 ========================
179 3. External dependencies
180 ========================
182 Some hints about getting the Imager module to find the libraries it
183 needs for specific features.
185 Most Linux distributions pre-package these. For each library I've
186 listed the Debian and Redhat package names.
188 For Debian or Debian based system, such as Ubuntu, you would run:
190 aptitude install package-name
194 apt-get install package-name
196 at a root shell (or via sudo).
200 apt-get install libjpeg62-dev
202 For a Redhat based system such as CentOS or Fedora you would run:
204 yum install package-name
210 yum install libjpeg-devel
212 I strongly recommend using your distribution's packages if possible,
213 this will mean any security updates to those packages will be applied
214 when you install security updates.
219 http://www.ijg.org/files/
220 ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
222 Provides read and write access to JPEG images.
228 to install the development headers and libraries before attempting to
231 Debian: libjpeg62-dev
232 Redhat: libjpeg-devel
237 http://www.libpng.org/pub/png/libpng.html
239 Provides read and write access to PNG images.
241 You also need zlib to use png: http://www.gzip.org/zlib/ We have
242 encountered problems with libpng 1.0.1, which were fixed in 1.0.5
243 Note: you should probably be using zlib 1.1.4, since 1.1.3 has a
244 potential security problem.
252 http://sourceforge.net/projects/giflib/
254 Provides read and write access to GIF images.
256 giflib/libungif has come a long way since the buggy versions available
257 when Imager's gif support code was written. Preferably you should get
258 at least version 4.1.4. If you have a recent Linux distribution you
259 should be safe with whatever giflib it provides, but if you're
260 building from source, please try to use the latest version.
262 With the expiration of the LZW patent there's no reason to use
265 libgif 4.1.4 has no problems known to me at this point.
273 http://www.remotesensing.org/libtiff/
275 Provides read and write access to TIFF images.
277 Note: libtiff 3.9.0 shouldn't be used due to a bug in
278 TIFFWriteDirectory().
281 Redhat: libtiff-devel
286 http://www.t1lib.org/
287 ftp://sunsite.unc.edu/pub/Linux/libs/graphics/
289 Support for text drawing with Type 1 Postscript fonts.
294 3.6 Freetype 2.x (libfreetype)
295 ------------------------------
297 http://www.freetype.org/
299 Support for text drawing with a large number of font formats,
300 including Truetype, Type 1, Opentype and some bitmap formats.
302 Debian: libfreetype6-dev
303 Redhat: freetype-devel
305 3.7 Freetype 1.x (libttf)
306 -------------------------
308 http://www.freetype.org/
310 Support for text drawing with Truetype fonts.
312 This library has been superceded by Freetype 2, and some Linux
313 distributions are phasing it out.
316 Redhat: freetype1-devel
321 Precompiled versions of some of the libraries might be found at:
325 http://www.bullfreeware.com/
329 http://www.sunfreeware.com/
331 ========================
332 4. Logging and debugging
333 ========================
335 Logging is compiled in by default - if you should want to get of it
336 from the binaries you can do so by setting the env IMAGER_NOLOG
337 to something. If you want to enable malloc debugging to check for leaks
338 then set IMAGER_DEBUG_MALLOC to something. Needless to say it is
339 pretty pointless to have malloc debug enabled with no logging since you
340 can never see the malloc information that way.
347 Imager can be installed on Win32 systems. This was ported and tested
348 with Microsoft Visual C++ 6.0 with build 623 of ActivePerl. You can
349 use all of the features of Imager. You can also use Win32 GDI fonts
350 directly by supplying the 'face' parameter to Imager::Font->new(...).
352 I've tested with MSVC++ 6.0, cygwin (perl 5.6.1) and gcc (MinGW).
354 If you see an error under cygwin during testing along the lines of:
356 C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\...some dll to the
357 same address as parent (0x...) != 0x....
359 you will need to install the cygwin rebase package and run:
363 If you get errors from your make tool, make sure you're using the same
364 make that was used to build your perl - generally GNU make for cygwin,
365 nmake for Visual C/C++ and dmake for MinGW.
367 Imager and all of the libraries it requires are supplied with
374 Building Imager under OS X is generally straightforward. There are
375 some exceptions though:
377 a) you may find to need to ranlib library files in place after you've
378 installed them, for example:
380 ranlib /usr/local/lib/libgif.a
382 b) the version of GCC enabled by default on OS X 10.4 generates
383 incorrect code for some functions. To work around this run:
387 before building Imager and:
391 after building Imager.
393 This problem exhibits itself as test failures in t/t20fill.t
395 Imager 0.56 includes a workaround for this problem, but I wasn't
398 c) if you want to build GCC 4.0 from scratch and use that you will
399 need to adjust the command-line supplied during the link stage, so
400 that there is some other option before the -bundle option.
404 perl Makefile.PL LDDLFLAGS="`perl -MConfig -e 'print "-g $Config{lddlflags}"'`"
406 =======================
407 7. General information
408 =======================
410 The Imager module homepage is currently at:
412 http://imager.perl.org/
414 You can report bugs by pointing your browser at:
416 https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Imager
418 ========================
420 ========================
424 Claes Jacobson ( Claes )
425 Philip Gwyn ( Leolo )
426 Michael Slade ( Micksa )
428 Brad Murray ( HalfJack )
429 Nicholas Dronen ( Veblen )
430 Michael G Schwern ( Schwern )
431 Rocco Caputo ( Dngor )
432 Graham barr ( Gbarr )
433 Mark-Jason Dominus ( Mjd )
435 Jason Alexander ( Jalex )
436 Randal R. Schwartz ( Merlyn )
438 Artur Bergman ( Sky )
439 Luc St-Louis ( Lucs )
441 Roderick Schertler ( Roderick )
442 Nathan Torkington ( gnat )
445 (and just to play it safe) all those I forgot to mention.