forked from rmagick-temp/rmagick
/
README.html
404 lines (392 loc) · 18.8 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1st September 2002), see www.w3.org">
<title>RMagick MAJOR.MINOR.TEENY README</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
</head>
<body>
<div align="center">
<h1>RMagick MAJOR.MINOR.TEENY</h1>
<h2>README</h2>
<h4>YY/MM/DD</h4>
</div>
<h2>Table of Contents</h2>
<ul>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#contact_information">Contact
information</a></li>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#tips">Tips for installing and configuring
ImageMagick and GraphicsMagick</a></li>
<li><a href="#installing_rmagick">Installing RMagick</a>
<ul>
<li><a href="#configuration_options">Configuration
options</a></li>
<li><a href="#running">Running the configure and make
scripts</a></li>
</ul>
</li>
<li><a href="#things_that_can_go_wrong">Things that can go
wrong</a></li>
<li><a href="#upgrading">Upgrading</a></li>
<li><a href="#uninstalling">Uninstalling</a></li>
<li><a href="#more_samples">More samples</a></li>
<li><a href="#undocumented_features">Undocumented
features</a></li>
<li><a href="#known_issues">Known issues</a></li>
<li><a href="#reporting_bugs">Reporting bugs</a></li>
<li><a href="#credits">Credits</a></li>
<li><a href="#license">License</a></li>
</ul>
<h2><a name="introduction">Introduction</a></h2>
<p>RMagick is an interface between the Ruby programming
language and the ImageMagick and GraphicsMagick image
processing libraries.</p>
<h2><a name="contact_information">Contact Information</a></h2>
<b>Author:</b> Tim Hunter<br>
<b>Email:</b> <a href=
"mailto:rmagick@rubyforge.org">rmagick@rubyforge.org</a><br>
<b>RubyForge:</b> <a href="http://rubyforge.org/projects/rmagick">RMagick</a><br>
<h2><a name="prerequisites">Prerequisites</a></h2>
<dl>
<dt><b>O/S</b></dt>
<dd>Linux, Sun Solaris, Cygwin, FreeBSD, MS Windows 98 and later.</dd>
<dt><b>Ruby</b></dt>
<dd>Ruby 1.6.7 or later. You can get Ruby from
<a href="http://www.ruby-lang.org">www.ruby-lang.org</a></dd>
</dl>
One of
<dl>
<dt><b>ImageMagick</b></dt>
<dd>ImageMagick 6.0.0 or later. You can get ImageMagick
from <a href="http://www.imagemagick.org">www.imagemagick.org</a>.</dd>
<dt><b>GraphicsMagick</b></dt>
<dd>GraphicsMagick is a friendly fork of ImageMagick 5.5.1.
You can get GraphicsMagick from <a href="http://www.graphicsmagick.org">www.graphicsmagick.org</a>.</dd>
</dl>
<p>You only need one of ImageMagick or GraphicsMagick. RMagick
works equally well with both. Some RMagick methods may not be supported in one or the other library.</p>
<h2><a name="tips">Tips for installing and configuring
ImageMagick and GraphicsMagick</a></h2>
<p>if you are installing RMagick by compiling the source code,
I <em>strongly</em> encourage you to install the latest version
of ImageMagick or GraphicsMagick <em>from source</em>.
If you have never installed ImageMagick or GraphicsMagick
before, I also strongly encourage you to
read the README.txt file as many times as is necessary for you
to understand how to configure it. ImageMagick and
GraphicsMagick are large and complicated programs and can be
difficult to configure. Follow these tips to minimize the
amount of time you'll spend and your frustration level.</p>
<p>Do <i>not</i> simply type ./configure and expect the
defaults to be correct for you. Since you are installing ImageMagick/GraphicsMagick to use
with Ruby, consider whether you want to skip
ImageMagick's/GraphicMagicks' support for Perl and C++ by using
the --without-perl and --without-magick-plus-plus options.
Doing so will speed up the installation process and save some
disk space. You will almost certainly want to specify the
--enable-shared and --disable-static options.</p>
<p>Determine which image formats you are interested in using
and make sure that you have installed the libraries that
ImageMagick/GraphicsMagick uses to process these formats.
ImageMagick and GraphicsMagick use additional libraries to
support some image formats. If you do not install those
libraries you cannot read and write those image formats. You
will need to configure ImageMagick/GraphicsMagick to support
the JPG, PNG, TIFF, and WMF formats in order to execute all the
RMagick sample programs. See ImageMagick's or GraphicMagick's
README.txt file for more information.</p>
<p>Once you have determined the configuration options you need,
run the configure script. When it completes, read the summary
output to see if configuration worked the way you expected.
Here's an example of the summary output from ImageMagick's
configure script. Notice that the result of each option is
listed in the "Configured value" column.</p>
<pre>
Option Value
-------------------------------------------------------------------------
Shared libraries --enable-shared=yes yes
Static libraries --enable-static=no no
Module support --with-modules=yes yes
GNU ld --with-gnu-ld=yes yes
LZW support --enable-lzw=yes yes
Quantum depth --with-quantum-depth=8 8
Delegate Configuration:
BZLIB --with-bzlib=yes yes
DPS --with-dps=yes yes
FlashPIX --with-fpx=yes no
FreeType 2.0 --with-ttf=yes yes
Ghostscript None gs (7.07.2)
Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/default/Type1/
Ghostscript lib --with-gslib=no no
Graphviz --with-dot=yes no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=yes no
LCMS --with-lcms=yes yes
Magick++ --with-magick-plus-plus=no no
PERL --with-perl=no no
PNG --with-png=yes yes
TIFF --with-tiff=yes yes
Windows fonts --with-windows-font-dir=/mnt/windows/windows/fonts /mnt/windows/windows/fonts/
WMF --with-wmf=yes yes
X11 --with-x= yes
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes
X11 Configuration:
X_CFLAGS = -I/usr/X11R6/include
X_PRE_LIBS = -lSM -lICE
X_LIBS = -L/usr/X11R6/lib
X_EXTRA_LIBS =
</pre>
<p>If the results are not what you wanted, install any missing
libraries, choose new or different options, or whatever it
takes, erase the config.cache file, and re-run configure.
Repeat as often as necessary before moving to the `make' and
`make install' steps.</p>
<p>Detailed information about all of ImageMagick's and
GraphicsMagick's configuration options may be found in their
README.txt and INSTALL.txt files.</p>
<h4>Windows Metafile Format</h4>
<p>As noted in the ImageMagick and GraphicsMagick README.txt
files, to support images in the Windows Metafile format,
ImageMagick/GraphicsMagick requires an additional library.
Without this library some of the RMagick sample programs will
not work. ImageMagick and GraphicsMagick require libwmf 0.2.5,
0.2.7, or 0.2.2 to support the WMF format. (Avoid libwmf
0.2.6!)</p>
<h2><a name="installing_rmagick">Installing RMagick</a></h2>
<p>Installing RMagick is much simpler than installing
ImageMagick or GraphicsMagick. Note that the <i>make</i> step
runs all the example programs. This process both builds the
example images used in the documentation and validates your
RMagick installation. This step can take 5-15 minutes depending
on the speed of your computer.</p>
<h4><a name="configuration_options">Configuration
options</a></h4>
<p>Type <code>./configure --help</code> to see a list of
configuration options. In addition to the regular options,
there are a few RMagick-specific options:</p>
<dl>
<dt>--with-doc-dir=directory</dt>
<dd>
Specify the directory to install the RMagick documentation.
By default this is $prefix/share/RMagick, where $prefix is
the prefix specified by --prefix. For example, to install
the documentation in /home/user/RMagick, specify:
<pre>
./configure --with-doc-dir=/home/user/RMagick
</pre>
</dd>
<dt>--enable-allow-example-errors</dt>
<dd>Normally the documentation installation terminates if 5
examples fail. If you use this option, the installation does
not check for failing examples and will always complete. This
option is useful if you're having trouble installing RMagick
and you want to see all the failing examples.</dd>
<dt>--with-graphics-magick</dt>
<dd>If you have both ImageMagick and GraphicsMagick installed, this option will force RMagick to be configured with GraphicsMagick.</dd>
<dt>--with-so-dir=directory</dt>
<dd>The directory for ruby extensions.</dd>
<dt>--with-ruby-path=directory</dt>
<dd>The path to set the !# line in Ruby scripts. The default is <code>$prefix/bin/ruby</code>.</dd>
<dt>--with-ruby-prog=name</dt>
<dd>The name of the Ruby executable. The default is <code>ruby</code>.</dd>
<dt>--with-make-prog=name</dt>
<dd>The name of the <code>make</code> program.</dd>
<dt>--with-rbconfig=path</dt>
<dd>The path to the rbconfig.rb file to use. The default is Ruby's rbconfig.</dd>
</dl>
<br>
<h4><a name="running">Running the <code>configure</code> and
<code>make</code> scripts</a></h4>
<p>De-compress the RMagick-MAJOR.MINOR.TEENY.tar.gz archive and
enter the top directory. Then type:</p>
<pre>
$ ./configure <configuration options>
$ make
($ su)
$ make install
(optionally)
$ make clean
</pre>
<h2><a name="things_that_can_go_wrong">Things that can go
wrong</a></h2>
<dl>
<dt><b>Cannot open shared object file</b></dt>
<dd>
<p>When <code>make</code> is running the examples, if you get
a message like this:</p>
<pre>
/home/you/RMagick-MAJOR.MINOR.TEENY/lib/RMagick.rb:11:in `require': libMagick.so.0:
cannot open shared object file: No such file or directory -
/home/you/RMagick-MAJOR.MINOR.TEENY/ext/RMagick/RMagick.so (LoadError)
</pre>
<p>you probably do not have the directory in which the
ImageMagick or GraphicsMagick library is installed in your
load path. An easy way to fix this is to define the
directory in the LD_LIBRARY_PATH environment variable. For
example, suppose you installed the GraphicsMagick library
libGraphicsMagick.so in /usr/local/lib. (By default this is
where it is installed.) Create the LD_LIBRARY_PATH variable
like this:</p>
<pre>
export LD_LIBRARY_PATH=/usr/local/lib
</pre>
<p>On Linux, see <code>ld(1)</code> and
<code>ld.so(8)</code> for more information. On other
operating systems, see the documentation for the dynamic
loading facility.</p>
</dd>
<dt><b>No such file or directory -
"/tmp/rmagick6872.6"</b></dt>
<dd>
<p>When <code>make</code> is running the examples, if you get
a message like this:</p>
<pre>
hook /home/me/src/RMagick-MAJOR.MINOR.TEENY/./post-setup.rb failed:
No such file or directory - "/tmp/rmagick6872.6"
</pre>
<p>you probably do not have a temporary directory
environment variable set. Set the TMPDIR environment
variable to your temporary directory. For example:</p>
<pre>
export TMPDIR=/home/me/tmp
</pre>
</dd>
</dl>
<h2><a name="upgrading">Upgrading</a></h2>
<p>If you upgrade to a newer release of ImageMagick or
GraphicsMagick, make sure you're using a release of RMagick
that supports that release. Usually I put out a new release of
RMagick with every new release of ImageMagick. It's safe to
install a newer release of RMagick over an earlier release.</p>
<h2><a name="uninstalling">Uninstalling</a></h2>
<p>The `uninstall' target will uninstall RMagick completely:</p>
<blockquote><code>make uninstall</code></blockquote>
<h2>More samples</h2>
<p>You can find more sample RMagick programs in the /example
directory. These programs are not installed in the RMagick
documentation tree.</p>
<h2><a name="undocumented_features">Undocumented
features</a></h2>
<p>This release includes an extra feature that isn't in the
documentation. The Magick module defines two methods that
control ImageMagick's logging function. This function is not
officially documented by ImageMagick, so I have decided not to
add them to RMagick's documentation. However, you may find them
helpful for debugging your application. (Caveat: these two
methods may change behavior or be removed without advance
notice! You are on your own!)</p>
<p><i>Magick::set_log_event_mask(event [,...]) ->
Magick</i></p>
<p>The arguments are one or more "event domains". The
set_log_event_mask method recognizes these event domains:
"all", "annotate", "blob", "cache", "coder", "configure",
"deprecate", "draw", "locale", "none", "resource", "transform", "user",
and "x11". ImageMagick events that match the mask are logged.
The default domain is "none". For example,</p>
<pre>
Magick::set_log_event_mask("render")
</pre>
<p>Logging is controlled by the log.mgk file, which may be
found in the same directory as the delegates.mgk files. (See
ImageMagick's README.txt file.) The purpose of the entries in
this file is undocumented, so your guess is as good as mine.
Also, the meaning of the event domains and exactly what events
are logged are undocumented.</p>
<p><i>Magick::set_log_format(format) -> Magick</i></p>
<p>The default log format is described in the log.mgk file.
This method allows you to redefine the format at run-time. The
format argument is a string similar to an fprintf format
string. Each line in the log has the format described by the
format string. Characters that are not control characters are
printed as-is. The control characters are:</p>
<pre>
%t - the current time
%r - the elapsed time
%u - the user time
%p - the pid (process id)
%m - the name of the ImageMagick source file that contains the
function that generated the event
%f - the name of the ImageMagick function that generated the
event
%l - the line number in the source file
%d - the event domain (one of the event mask strings listed above)
%e - the event name
</pre>
<p>For example, the default log format is:</p>
<pre>
Magick::set_log_format("%t %r %u %p %m/%f/%l/%d:\n %e")
</pre>
<h2><a name="known_issues">Known issues</a></h2>
<ol>
<li>
gcc 3.2, during the "install.rb setup" step, issues the
warning:
<pre>
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning: as it has already been specified as a non-system directory
</pre>
This does not indicate a problem.
</li>
<li>
With older releases of ImageMagick you may see the warning:
<pre>
/usr/include/sys/ipc.h:25:3: warning: #warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
</pre>
This is harmless.
</li>
</ol>
<h2><a name="reporting_bugs">Reporting bugs</a></h2>
<p>Please report bugs in RMagick, its documentation, or its
installation programs to me via the bug tracker on the
<a href="http://rubyforge.org/projects/rmagick/">RMagick project page</a>
at RubyForge.
However, I cannot help with Ruby installation and configuration
or ImageMagick or GraphicsMagick installation and
configuration. Please report problems with that software to
their respective authors or distributors.</p>
<h2><a name="credits">Credits</a></h2>
<p>Thanks to</p>
<ul>
<li>Akinori MUSHA, for his work making RMagick available on
FreeBSD.</li>
<li>Tom Payne, for reporting bugs, sending me the Ruby 1.8.0
patches, and for the Gentoo ebuild.</li>
<li>Bob Friesenhahn, for GraphicsMagick. Also for his help with
the RMagick installation and many other things.</li>
<li>
Simple Systems, for hosting the RMagick documentation online.
</li>
<li>Mike Williams, for the RMagick Debian package</li>
<li>ImageMagick Studio LLC, for ImageMagick and for
hosting the RMagick documentation.</li>
<li>Kaspar Schiess, for the MS Windows gem.</li>
</ul>
<h2><a name="license">License</a></h2>
<div style="padding: 1em; margin-left: 5%; margin-right: 5%; background-color: #dcdcdc">
<p>Copyright © 2004 by Timothy P. Hunter</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </p> </div>
<div align="center" style="padding: 3em">
<table>
<tr>
<td>
<a href="http://www.opensource.org/docs/definition.php">
<img src="http://www.opensource.org/trademarks/osi-certified/web/osi-certified-60x50.gif"
border="0" width="60" height="50"></a>
<td align="center">
<p><strong>This software is OSI Certified Open Source Software.<br>
OSI Certified is a certification mark of the Open Source Initiative.</strong></p>
</td></tr></table>
</div>
</body>
</html>