1Imager::Install(3) User Contributed Perl Documentation Imager::Install(3)
2
3
4
6 Imager::Install - installation notes for Imager
7
9 perl Makefile.PL
10 make
11 make test
12 make install
13
15 Assuming you have all of your required libraries in the places Imager
16 looks, you should be able to use the standard mantra:
17
18 perl Makefile.PL
19 make
20 make test
21 make install
22
23 to install Imager.
24
25 If you've installed libraries in places Imager doesn't look, you can
26 supply extra locations either with command-line options:
27
28 perl Makefile.PL --libpath=/home/tony/local/lib --incpath=/home/tony/local/include
29
30 or with environment variables:
31
32 export IM_LIBPATH=/home/tony/local/lib IM_INCPATH=/home/tony/local/include
33 perl Makefile.PL
34
35 Imager's Makefile.PL produces an epilogue indicating which libraries
36 have and haven't been found, for example:
37
38 Libraries found:
39 FT2
40 GIF
41 JPEG
42 PNG
43 T1
44 TIFF
45 Libraries *not* found:
46 Win32
47
48 If a library you expect to be found isn't on this list, use the
49 "--verbose" or "-v" option to produce way too much information from
50 Imager's search for the libraries:
51
52 perl Makefile.PL -v
53
54 If you can't resolve this, then run
55
56 perl errep.perl
57
58 and include the (large) generated report.txt in your email to:
59
60 bug-Imager@rt.cpan.org
61
62 There are other options used to configure how Imager is built:
63
64 "--nolog"
65 build Imager without logging support. This will speed up Imager a
66 little. You can also remove logging by setting the "IMAGER_NOLOG"
67 environment variable to a true value.
68
69 "--coverage"
70 used to build Imager for "gcov" coverage testing. This is intended
71 for development and also requires options supplied to "make".
72
73 "--assert"
74 build Imager with assertions enabled.
75
76 "--tracecontext"
77 build Imager to trace context object management to "stderr" for
78 debugging.
79
80 Build time environment variables
81 · "IMAGER_NOLOG" - build Imager with logging disabled.
82
83 · "IMAGER_DEBUG_MALLOC" - build Imager with it's debug malloc
84 wrappers. This is not compatible with threaded code.
85
86 · "IM_INCPATH" - equivalent to "--incpath".
87
88 · "IM_LIBPATH" - equivalent to "--libpath".
89
90 · "IM_VERBOSE" - equivalent to "--verbose"
91
92 · "IM_CFLAGS" - extra C compiler flags.
93
94 · "IM_LFLAGS" - extra linker flags.
95
96 · "IM_DFLAGS" - extra preprocessor flags.
97
99 Some of the file format and font modules included with Imager use
100 external libraries, which should be installed before you try to install
101 Imager itself.
102
103 If you don't have the libraries installed then Imager itself will
104 install successfully, but the file format or font support module won't
105 be.
106
107 Preferably the latest version of each library should be used, simple
108 because it has the latest security fixes.
109
110 PNG - "libpng"
111 Imager::File::PNG uses "libpng"
112 <http://www.libpng.org/pub/png/libpng.html> for PNG image file
113 support.
114
115 Debian package: "libpng12-dev"
116
117 Redhat package: "libpng-devel"
118
119 TIFF - "libtiff"
120 Imager::File::TIFF uses "libtiff"
121 <http://www.remotesensing.org/libtiff/> for GIF image file support.
122
123 Version 3.6.0 or later is required to avoid an exploit with infinite
124 IFD loops, though it's possible some distributions have applied the fix
125 to older versions as a security fix.
126
127 Version 3.9.0 is rejected during the probe process due to a serious
128 bug, fixed in 3.9.1.
129
130 Debian package: "libtiff4-dev"
131
132 Redhat package: "libtiff-devel"
133
134 GIF - "libgif"
135 Imager::File::GIF uses "libgif"
136 <http://sourceforge.net/projects/giflib/> for GIF image file support.
137
138 "libgif" releases 4.2.0 and 5.0.0 are specifically not supported, due
139 to bugs in those versions.
140
141 Release 4.1.4 or later should be used.
142
143 "giflib" 3 is no longer supported.
144
145 "libungif" is no longer supported as an alternative.
146
147 Debian package: "libgif-dev"
148
149 Redhat package: "giflib-devel"
150
151 JPEG - "libjpeg"
152 Imager::File::JPEG uses "libjpeg" <http://www.ijg.org/> for JPEG image
153 file support.
154
155 You may also use "libjpeg-turbo"
156 <http://sourceforge.net/projects/libjpeg-turbo/>.
157
158 To install older releases of "libjpeg" from source, you'll need to run:
159
160 make install-lib
161
162 to install the libraries. "make install" only installs the program
163 binaries.
164
165 Redhat package: "libjpeg-devel"
166
167 Debian package: "libjpeg8-dev"
168
169 Freetype 2.x - "libfreetype"
170 Imager::Font::FT2 uses Freetype 2 ("libfreetype")
171 <http://www.freetype.org/> for font support, supporting too many font
172 formats to mention here.
173
174 This is the recommended library to use for font support.
175
176 Debian package: "libfreetype6-dev"
177
178 Redhat package: "freetype-devel"
179
180 Win32 GDI fonts
181 Imager::Font::W32 uses Win32 GDI <http://msdn.microsoft.com/en-
182 us/library/dd145203%28v=vs.85%29.aspx> to render text using installed
183 Windows fonts.
184
185 This requires Win32 SDK headers and libraries, and is only expected to
186 work on native Win32 or Cygwin.
187
188 For this to work under Cygwin, install the "w32api-headers" and
189 "w32api-runtime" packages.
190
191 "t1lib"
192 Imager::Font::T1 uses "t1lib" <http://www.t1lib.org/> for font
193 support, supporting Postscript Type 1 fonts only.
194
195 Debian package: "libt1-dev"
196
197 Redhat package: "t1lib-devel"
198
199 Freetype 1.x - "libttf"
200 Imager uses Freetype 1 ("libttf") <http://www.freetype.org/> if
201 available for font support, supporting TTF fonts only.
202
203 Freetype 1.x is essentially unsupported and shouldn't be used for new
204 code.
205
207 Linux
208 Several distributions include an Imager package, but they are typically
209 several releases behind due to the nature of release cycles.
210
211 Imager typically supports the external libraries as packaged with any
212 supported release of Linux.
213
214 Debian
215
216 To install the libraries used by Imager under Debian (or Ubuntu), run
217 as root (or with sudo):
218
219 apt-get install libgif-dev libjpeg8-dev libtiff4-dev libpng12-dev libfreetype6-dev
220
221 You may also need to install development tools:
222
223 apt-get install build-essential
224
225 Redhat
226
227 To install the libraries used by Imager under Redhat and related Linux
228 distributions, run as root (or sudo):
229
230 yum install giflib-devel libjpeg-devel libtiff-devel libpng-devel freetype-devel
231
232 To install the development tools needed:
233
234 yum install gcc
235
236 (which appears to be enough on a base Redhat-like install) or the more
237 commonly recommended recipe:
238
239 yum groupinstall "Development Tools"
240
241 which is massive overkill.
242
243 Mac OS X
244 Building libraries
245
246 The default perl build in Snow Leopard and Lion is a fat binary, and
247 default builds of "giflib", "libpng" and "libjpeg" (and maybe other
248 libraries) will produce link failures.
249
250 To avoid this you need to supply a "CFLAGS" parameter to the library's
251 configure script, but since the "-arch" flag conflicts with the options
252 used to build the dependency files, you need to supply another flag to
253 disable dependency tracking.
254
255 Snow Leopard fat binaries include "i386", "x86_64" and "PPC" objects,
256 hence you would run configure like:
257
258 ./configure --disable-dependency-tracking CFLAGS='-arch x86_64 -arch i386 -arch ppc'
259
260 Lion doesn't support "PPC", so there you run configure like:
261
262 ./configure --disable-dependency-tracking CFLAGS='-arch x86_64 -arch i386'
263
264 For "libgif" you might also want to supply the "--without-x" option:
265
266 ./configure --disable-dependency-tracking --without-x CFLAGS='-arch x86_64 -arch i386'
267
268 If you copy library files into place manually, you may need to run
269 "ranlib" on them in their new location:
270
271 ranlib /usr/local/lib/libgif.a
272
273 Macintosh "dfont" and suitcase font support
274
275 Through Freetype 2.1, Imager can use Macintosh "DFON" (".dfont") fonts
276 and suitcase font files.
277
278 If you want to be able to use more than just the first face in the font
279 file though, you will need to configure "freetype2" with the
280 --with-old-mac-fonts option:
281
282 ./configure --with-old-mac-fonts
283
284 You can use the index option to get to the other font faces in the
285 file:
286
287 # get the second face from $file
288 my $font = Imager::Font->new(file=>$file, index=>1)
289 or die Imager->errstr;
290
291 If you're using a suitcase font, you will also need to force the use of
292 Freetype 2 with the type argument:
293
294 my $font = Imager::Font->new(file=>$suitcase, type=>'ft2', index=>$index)
295 or die Imager->errstr;
296
297 Microsoft Windows
298 The simplest way to install the libraries used by Imager is to install
299 Strawberry perl <http://strawberryperl.com/>.
300
301 You can then use either the bundled Imager, or install from CPAN.
302
303 If you get errors from your make tool, make sure you're using the same
304 make that was used to build your perl - "nmake" for Visual C/C++ and
305 "dmake" for MinGW, run:
306
307 perl -V:make
308
309 to see which make was used to build your perl.
310
311 Cygwin
312 To build Imager with as much library support as possible on Cygwin,
313 install the following packages:
314
315 libjpeg-devel libpng-devel libgif-devel libtiff-devel
316 libfreetype-devel t1lib-devel w32api-headers w32api-runtime
317
318 If you see an error under cygwin during testing along the lines of:
319
320 C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\...some dll to the
321 same address as parent (0x...) != 0x....
322
323 you will need to install the cygwin "rebase" package and run:
324
325 $ rebaseall -v
326
327 or possibly, just:
328
329 $ perlrebase
330
331 will fix the problem.
332
334 Freetype 1.x vs Freetype 2.x
335 Freetype 1.x is no longer recommended, is no longer supported upstream,
336 and receives only limited updates in Imager.
337
338 These two libraries have some conflicting include file names, but as
339 long as you don't put the Freetype 2.x freetype.h directory in the
340 include path it should all work.
341
342 Put the directory containing ft2build.h in the include path, but not
343 the directory containing the freetype 2.x freetype.h.
344
345 If you see compilation errors from font.c you've probably made the
346 mistake of putting the Freetype 2.x freetype.h directory into the
347 include path.
348
349 To see which directories should be in the include path, try:
350
351 freetype-config --cflags
352
353 Ideally, "freetype-config" should be in the PATH when building Imager
354 with freetype 2.x support, in which case Imager::Font::FT2 can
355 configure itself.
356
358 Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
359
360
361
362perl v5.28.1 2019-01-10 Imager::Install(3)