-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.txt
189 lines (143 loc) · 6.93 KB
/
README.txt
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
WHAT:
This binding is an ImageMagick interface for Objective Caml.
AUTHOR:
Copyright (C) 2004 2005 2006 2010 Florent Monnier
NOTICE:
"ImageMagick" is a registered trademark owned by ImageMagick Studio LLC
http://tarr.uspto.gov/servlet/tarr?regser=serial&entry=78333969
REQUISITES:
Objective Caml, which can be obtained from:
- http://caml.inria.fr/ocaml/
ImageMagick, which you will find at:
- http://www.imagemagick.org/script/download.php
A build environment with:
- bash, make, sed, install
VERSIONS:
This binding (this current verison) has been tested with OCaml version
'3.11.2' and ImageMagick version '6.6.1-5'.
Previous versions of this binding have been tested with OCaml versions
'3.08.4', '3.09.0', '3.09.2' and '3.11.1' and ImageMagick versions
'6.2.4', '6.2.5', '6.2.6' and '6.5.7'.
The old versions of this binding are still available at:
http://www.linux-nantes.fr.eu.org/~fmonnier/OCaml/IM-old.php
Please report success or failure with other versions.
If you encounter problems to compile from sources, email me and
I will make a static binary available.
BETA:
The interface to ImageMagick for OCaml is still in beta developement
and I have had very few feedback about success or failure from users yet,
so you should consider it as experimental and use it at your own risks!
Be warn that the name of the functions and the labeling may change too,
and you can also make requests for changes.
BUGS:
As I don't want you to be afraid by theese, I have put the bugs
descriptions at the end of this file :-)
INSTALL:
Run "make" to build the library, and "make install" to install it.
STATIC:
If you wish a static version, just follow the instructions in the Makefile.
TEST:
Run "make test" to run the examples in the 'examples' directory,
or "make test IMAGE=some_img.png" with an other black and white image
or logo.
DOCUMENTATION:
Run "make doc" to produce the HTML documentation.
You can also find the html documentation of the last release at:
http://www.linux-nantes.org/~fmonnier/OCaml/ImageMagick/IM-doc/
THREADS:
For threads issues, read this:
http://www.imagemagick.org/script/architecture.php#threads
TODO:
Next steps with OCaml-libMagick will be to improve the functional module.
Enhance the scripts to generate the 'imagemagick_list.c' file.
Wrapping not just the MagickCore but the MagickWand API too (well maybe...)
Trying to make this interface compatible with GraphicsMagick.
Use the OCaml BigArray module to improve the interoperability between
the OCaml and the ImageMagick worlds.
WIZARD:
If you wish to thank the author of ImageMagick, you can consider sending
to him a picture postcard of the area where you live. Send postcards to:
ImageMagick Studio LLC
P.O. Box 40
Landenberg, PA 19350
USA
He is also interested in receiving currency or stamps from around the world
for his collection.
THANKS:
Thanks to Matthieu Dubuget for his help to write the first Makefile with
OCamlMakefile, and for his help to resolve the dependencies of compilation.
Thanks to John Cristy for answering ALL my questions about the MagickCore API.
Thanks to Fabrice Le Fessant <[email protected]> for having found bugs
with allocated values not registered with CAMLlocal.
Thanks to Christophe Troestler <[email protected]> for his help
with big arrays.
Thanks to Bruspal for his book about the C language.
Thanks to all the guys of fr.comp.lang.caml who have answered to my questions.
Thanks to the authors of Objective Caml for this wonderfull language and
thanks to the authors of ImageMagick for this wonderfull library.
HOW TO USE IN THE BUILD DIRECTORY:
Use in byte-code:
ocamlc bigarray.cma magick.cma test.ml -o test.run
Use in native-code:
ocamlopt bigarray.cmxa magick.cmxa test.ml -o test.opt
Use in interactive-mode:
ocaml bigarray.cma magick.cma
Use in script-mode:
ocaml bigarray.cma magick.cma test.ml image.png
or
chmod u+x test.ml
./test.ml image.png
with the 2 first lines:
#!/usr/bin/env ocaml
#load "magick.cma"
HOW TO USE WITH THIS LIBRARY INSTALLED:
Use in byte-code:
ocamlc -I +libMagick bigarray.cma magick.cma test.ml -o test.run
Use in native-code:
ocamlopt -I +libMagick bigarray.cma magick.cmxa test.ml -o test.opt
Use in interactive-mode:
ocaml -I +libMagick bigarray.cma magick.cma
Use in script-mode:
ocaml -I +libMagick bigarray.cma magick.cma test.ml image.png
or
chmod u+x test.ml
./test.ml image.png
with the 3 first lines:
#!/usr/bin/env ocaml
#directory "+libMagick" ;;
#load "magick.cma" ;;
LICENSE:
This library is distributed under the terms of the zlib license:
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
You should have received a copy of the Zlib license along with
this program in the file 'LICENSE.txt';
if not, you can find it on the web at:
https://opensource.org/licenses/Zlib
KNOWN BUGS:
MINOR:
Images added into image lists are pointers, so if the image is not used
after it has been added into the list it could be garbage collected while
the list still points to it. As a temporary fix, use the function no_op
(see the documentation for more details).
MAJOR:
The DrawInfo structure is not freed with DestroyDrawInfo() at the end of
the draw_* functions, because it sometimes produces segfaults, I don't
know why, in fact it should not, so I have leaved the DestroyDrawInfo()
calls commented in the source, but perhaps this could lead to a memory
leak, but I have never experienced such a problem yet though, even with
big long time living scripts with lots of images loaded.
It is possible to enable the free() of the (DrawInfo *) structures with
setting MAKE_DESTROY_DRAWINFO to 1.
Please report success or failure related to this issue.
MEDIUM:
Imper in french sounds close to "impaire" which could be understood like
odd or the cloth you wear when it's raining out, so you can stay behind
the computer ;)
If you really prefer fun programming, you won't understand why this part
of the binding, since for imperative the wand api should be chosen.
When to fix all this arround, just put your hands in ;)