Commit ff9bd1e8 authored by Stephane Glondu's avatar Stephane Glondu

Merge tag 'upstream/4.2.0'

Upstream version 4.2.0
parents 88f211af 061a3abf
repo: e37886d73a98029822983bee73a2d90ceb4b298b
node: e471b3c4470d1515267d42047085f7d7b5630502
branch: for_4.02
tag: 4.2.0
\.apt-installed
.*\.cm[a-z]+$
.*~$
\.(sp[io]t|annot|o|cm[a-z]+|orig|omc|lock|a|so)$
......@@ -22,6 +23,9 @@ doc/sphinx/_build
test/out\.image$
test/test$
test/jpgexif$
test/jpgmark$
test/test2$
examples/converter/converter$
examples/converter-external/converter$
......
......@@ -2,3 +2,8 @@ ee82aa9b74ac04d5c8ee2e49825f96b4bc3f032c camlimages-4.0.0
ff3f1ccc87431ff26bf9dda1495c953505ecbd23 v4.0.1
ff3f1ccc87431ff26bf9dda1495c953505ecbd23 v4.0.1
0000000000000000000000000000000000000000 v4.0.1
0000000000000000000000000000000000000000 v4.0.1
c803efa9d5d33b908069f27f49b876e35853a708 v4.0.1
f650e32ed440423e2290e1ef819aecd8c99375bc 4.1.3
f650e32ed440423e2290e1ef819aecd8c99375bc 4.1.3
71025db891bd826fc1d608c2b52b8b9d3afdd218 4.1.3
#!/bin/sh
export ACLOCAL='aclocal -I ../autoconf'
autoreconf --install
./configure --prefix $PREFIX
make clean all install
cp src/*.sp?t $PREFIX/lib/ocaml/site-lib/camlimages/
(cd examples/liv; make opt; /bin/cp liv.opt $PREFIX/bin)
Version 2.12 of the CamlImages library, by Jun Furuse, François
Pessaux, and Pierre Weis, is now available.
CamlImages is an image processing library, which provides to the
objective Caml programmer:
** basic functions for image processing and loading/saving various image
file formats (hence providing a translation facility from format to format),
** an interface with the Caml graphics library allows to display
images in the Graphics module screen and to mix them with Caml
drawings,
** a freetype interface, integrated into the library:
you can draw texts into images using any truetype fonts,
** a set of example programs, including gif animation, slide show, postscript
converter to print images.
Version 2.12 adds support for lablgtk2 and is also a bug fix release.
Sources and documentation are available from:
http://pauillac.inria.fr/camlimages/eng.htm
ftp://ftp.inria.fr/INRIA/caml-light/bazar-ocaml/camlimages-2.12.tgz
Contributions and comments are welcome.
Hi,
I'm glad to announce the availability of the 4.0.1 version of the
CamlImages library, by Jun Furuse, François Pessaux, and Pierre Weis.
This is a bug fix release.
The software home page is:
http://cristal.inria.fr/camlimages/eng.htm
Sources and documentation are available from:
http://cristal.inria.fr/camlimages/camlimages-3.0.2.tgz
ftp://ftp.inria.fr/INRIA/Projects/cristal/caml-light/bazar-ocaml/camlimages-3.0.2.tgz
Contributions and comments are welcome.
Pierre Weis & June Furuse
CamlImages is an image processing library, which provides to the
objective Caml programmer a lot of image processing functionality.
CamlImages provides to the objective Caml programmer:
** basic functions for image processing and loading/saving various image
file formats (hence providing a translation facility from format to format),
** an interface with the Caml graphics library allows to display
images in the Graphics module screen and to mix them with Caml
drawings,
** a freetype interface, integrated into the library:
you can draw texts into images using any truetype fonts,
** a set of example programs, including gif animation, slide show,
and a postscript converter to print images.
4.2.0
* OCaml 4.02.0 string/bytes fix
4.1.2
* GIF lib version 5 support
* clang related compilation fixes
4.1.1
* omake --config clean up
* pkg-config is now used if exists in order to seek external libraries
4.1.0
* bmp was not linked with examples. Since bmp is pure ML libarary,
you may need to add -linkall to linker command to your build script,
otherwise the module is silently ignored.
* bmp 32bit RGBA is now supported
* added jpeg marker load/saving (not tested well)
* added exif support (you need libexif)
! refactored ocamlfind package names (probably introduce some incompatibility)
* removed unused old configure and make scripts
* Applied GODI's patches. Now omake takes the following variable definitions:
- INCLUDES
- LDFLAGS
- NATIVE_ENABLED
- ARG_WANT_XXX
- ARG_PATH_GS
- ARG_FREETYPE_CONFIG
If they are not defined, some default values are deduced.
4.0.2
* ppm save was somehow disabled.
4.0.1
* Minor bug fixes, patch submitted by Damien Doligez
......
*** This is OBSOLETE.
This document describes how to build camlimages using automake,
which is now OBSOLETE and no longer supported.
*** Requirements
To install CamlImages library, you need the following softwares:
* ocaml 3.11 or higher
* GNU make
* automake (1.7.9 does not work. 1.9.6 works)
and that is all. But note that this is the minimum requirement: you
can read/write BMP or PXM (PPM, PGM, PBM) image formats but no other
formats. If you want to deal with other image formats, you need to
install the corresponding external libraries:
* libpng for PNG format
http://www.libpng.org/pub/png/libpng.html
http://sourceforge.net/projects/libpng/
* libjpeg for JPEG format
The Independent JPEG Group's software
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
* libtiff for TIFF format
http://www.libtiff.org/
ftp://ftp.remotesensing.org/pub/libtiff/
* libxpm for XPM format (could be already by the X server installation)
X contrib libraries ftp directory
ftp://ftp.x.org/contrib/libraries
* freetype for drawing texts using truetype fonts
The FREETYPE Project
http://sourceforge.net/projects/freetype/
* libungif for GIF format
Because of the GIF patent problem of Unisys, we do not
recommend to use GIF file format. If you really want to
use GIF, do it in your own risk.
Libungif, a library for using GIFs without compression.
http://sourceforge.net/projects/libungif/
* ghostscript for PS format
See http://www.ghostscript.com/
* lablgtk2, an Objective Caml interface to gtk+
http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
*** Installation procedure by automake
Generating build scripts
------------------------
* make sure ocaml autoconf macros, available from bazar-ocaml/autoconf
directory (http://camlcvs.inria.fr/cgi-bin/cvsweb/bazar-ocaml/autoconf/),
are present in aclocal macro search path, by any of the following
solution:
- export ACLOCAL='aclocal -I <directory>' before invoking autoreconf
- set up a dirlist file in automake macro directory, as explained in aclocal
documentation
* run autoreconf --install
Configuration
-------------
Just run the standard configure script:
% ./configure
If the script can't find some installed external libraries, this is probably
because they are installed in locations not included in linker or
preprocessor configuration. You'll have to passe proper flags while running
configure script:
%./configure CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
%./configure CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib
If problems persist, check config.log for failure details.
The script allow some user configuration. Check help output for details:
% ./configure --help
Compilation
-----------
type
% make
and wait.
Test
----
Before you actually install the library, you can check that it
really works, by running examples in the test directory. For the test
programs,
% cd test
% make
% ./test
% ./test.byt
(./test.byt is the bytecode executable and ./test the binary
executable).
Installation
------------
If there is no compilation error and the test works fine,
install the library,
% make install
This installs all the required files into the $(LIBDIR) directory
specified in Makefile.config (usually /usr/local/lib/ocaml/camlimages
or /usr/lib/ocaml/camlimages).
If you want to create a toplevel with camlimages, type in
% make top
that creates a toplevel named "customtop". Then,
% toplevel
executes customtop with the appropriate options.
Example applications
--------------------
In the examples directory you can find several example applications
using Camlimages.
Some of the programs use the lablgtk GUI (in particular liv and
gifanim): you cannot compile them if the lablgtk library has not
been installed.
To compile the examples execute:
% cd examples
% make
=========================================================
CamlImages - Objective Caml image processing library
=========================================================
Requirements
=================
To install CamlImages library, you need the following softwares:
* OCaml 4.01.0 or higher
* Findlib (aka ocamlfind, http://www.camlcity.org/archive/programming/findlib.html )
* OMake ( http://omake.metaprl.org/index.html )
Note that this is the minimum requirement: you can read/write BMP or
PXM (PPM, PGM, PBM) image formats but no other formats. If you want to
deal with other image formats, you need to install the corresponding
external libraries:
* libpng for PNG format
* libjpeg for JPEG format
* libexif for EXIF tags in JPEG files
* libtiff for TIFF format
* libxpm for XPM format (could be already by the X server installation)
* freetype for drawing texts using truetype fonts
* libungif/libgif for GIF format
* ghostscript for PS format
* lablgtk2, an OCaml interface to gtk+
Installation
=====================================
::
% yes no | omake --install
% omake --configure <configuration options>
% omake install
At omake --configure, you can specify CFLAGS and LDFLAGS
to add extra header and library search paths respectively. For example,::
% omake --configure CFLAGS="-I /usr/include/libexif" LDFLAGS="-L/opt/blah"
List of configurable variables
---------------------------------
CFLASG, INCLUDES, LDFLAGS: as usual.
ARG_WANT_<feature>=bool
Without specifying ARG_WANT_<feature>, omake --configure automatically
searches the availability of <feature> and enables it when found.
If ARG_WANT_<feature>=0, the feature is not checked, and disabled.
If ARG_WANT_<feature>=1, the feature must exist and is enabled.
If omake fails to find the feature, the entire build fails.
Currently the following features are available:
GIF, PNG, JPEG, EXIF, TIFF, XPM, GS, LABLGTK2, GRAPHICS, FREETYPE
ARG_PATH_PKG_CONFIG=string
ARG_PATH_FREETYPE_CONFIG=string
ARG_PATH_GS=string
PATH of external commands like pkg-config, freetype-config and gs
Without specifying, omake tries to find them in the PATH.
Test
----
Before you actually install the library, you can check that it
really works, by running examples in the test directory. For the test
programs,::
% cd test
% omake
% ./test
% ./test.run
(./test.run is the bytecode executable and ./test the binary
executable).
Where to report building issues?
==========================================================
https://bitbucket.org/camlspotter/camlimages/issues?status=new&status=open
CamlImages - Objective Caml image processing library
This library is reliable but still under development.
*** Requirements
To install CamlImages library, you need the following softwares:
* ocaml 3.11.x or higher
* findlib (aka ocamlfind,
http://www.camlcity.org/archive/programming/findlib.html)
* omake (http://omake.metaprl.org/index.html)
Note that this is the minimum requirement: you can read/write BMP or
PXM (PPM, PGM, PBM) image formats but no other formats. If you want to
deal with other image formats, you need to install the corresponding
external libraries:
* libpng for PNG format
http://www.libpng.org/pub/png/libpng.html
http://sourceforge.net/projects/libpng/
* libjpeg for JPEG format
The Independent JPEG Group's software
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
* libtiff for TIFF format
http://www.libtiff.org/
ftp://ftp.remotesensing.org/pub/libtiff/
* libxpm for XPM format (could be already by the X server installation)
X contrib libraries ftp directory
ftp://ftp.x.org/contrib/libraries
* freetype for drawing texts using truetype fonts
The FREETYPE Project
http://sourceforge.net/projects/freetype/
* libungif for GIF format
Because of the GIF patent problem of Unisys, we do not
recommend to use GIF file format. If you really want to
use GIF, do it in your own risk.
Libungif, a library for using GIFs without compression.
http://sourceforge.net/projects/libungif/
* ghostscript for PS format
See http://www.ghostscript.com/
* lablgtk2, an Objective Caml interface to gtk+
http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
*** Installation procedure by omake
% omake
% omake install
*** OLD installation procedure by automake (not supported any more)
* GNU make
* automake (1.7.9 does not work. 1.9.6 works)
Generating build scripts
------------------------
This is only needed if you're using CVS version directly.
* make sure ocaml autoconf macros, available from bazar-ocaml/autoconf
directory, are present in aclocal macro search path, by any of the following
solution:
- export ACLOCAL='aclocal -I <directory>' before invoking autoreconf
- set up a dirlist file in automake macro directory, as explained in aclocal
documentation
* run autoreconf --install
Configuration
-------------
Just run the standard configure script:
% ./configure
If the script can't find some installed external libraries, this is probably
because they are installed in locations not included in linker or
preprocessor configuration. You'll have to passe proper flags while running
configure script:
%./configure CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
%./configure CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib
If problems persist, check config.log for failure details.
The script allow some user configuration. Check help output for details:
% ./configure --help
Compilation
-----------
type
% make
and wait.
Test
----
Before you actually install the library, you can check that it
really works, by running examples in the test directory. For the test
programs,
% cd test
% make
% ./test
% ./test.byt
(./test.byt is the bytecode executable and ./test the binary
executable).
Installation
------------
If there is no compilation error and the test works fine,
install the library,
% make install
This installs all the required files into the $(LIBDIR) directory
specified in Makefile.config (usually /usr/local/lib/ocaml/camlimages
or /usr/lib/ocaml/camlimages).
If you want to create a toplevel with camlimages, type in
% make top
that creates a toplevel named "customtop". Then,
% toplevel
executes customtop with the appropriate options.
Example applications
--------------------
In the examples directory you can find several example applications
using Camlimages.
Some of the programs use the lablgtk GUI (in particular liv and
gifanim): you cannot compile them if the lablgtk library has not
been installed.
To compile the examples execute:
% cd examples
% make
This diff is collapsed.
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE 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 FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.
########################################################################
# The standard OMakeroot file.
# You will not normally need to modify this file.
# By default, your changes should be placed in the
# OMakefile in this directory.
#
# If you decide to modify this file, note that it uses exactly
# the same syntax as the OMakefile.
#
#
# Include the standard installed configuration files.
# Any of these can be deleted if you are not using them,
# but you probably want to keep the Common file.
#
open build/C
open build/OCaml
open build/LaTeX
#
# The command-line variables are defined *after* the
# standard configuration has been loaded.
#
DefineCommandVars()
#
# Include the OMakefile in this directory.
#
.SUBDIRS: .
......@@ -24,6 +24,26 @@ OCAML_WHERE = $(shell ocamlc -where)
open configure/Configure
public.CheckCLib(libs, funs) =
# This is broken in omake:
LDFLAGS += $(addprefix -l, $(libs))
program = $"""
#ifdef __cplusplus
extern "C"
#endif
#pragma warning( disable : 4100 )
/* Override any gcc2 internal prototype to avoid an error. */
$(add-wrapper $(nl)extern char , $'();', $(funs))
int main(int argc, char **argv) {
/* Usage */
$(add-wrapper $(nl) , $'();', $(funs))
return 0;
}
"""
#echo "program = $(program)"
return $(TryLinkC $(program))
Check_header_library(xlib, xheader, xfunc) =
return $(and $(VerboseCheckCHeader $(xheader)), $(VerboseCheckCLib $(xlib), $(xfunc)))
......@@ -35,10 +55,6 @@ Check_ocamlfind_package(package) =
ConfMsgChecking($(package))
ConfMsgFound($(shell-success ocamlfind query $(package)))
Check_pkg_config(package, option) =
ConfMsgChecking(Freetype)
ConfMsgFound($(shell-success $(package)-config $(option)))
where1(com) =
WHERE = $(where $(prog))
if $(WHERE)
......@@ -50,10 +66,9 @@ where1(com) =
Check_prog_in_path(prog) =
ConfMsgChecking(for $(prog))
WHERE = $(where1 $(prog))
export WHERE
if $(WHERE)
ConfMsgResult(found $(WHERE))
return true
return $(WHERE)
else
ConfMsgResult(FAILED - no $(prog) found)
return false
......@@ -86,8 +101,10 @@ Word_size() =
Check_ocamlfind_package_compilation(package, module) =
ConfMsgChecking($(package) compilability: open $(module))
tmp_ml = $(file $(tmpfile omake, .ml))
ConfMsgChecking($(tmp_ml))
tmp = $(file $(replacesuffixes .ml, $"$(EMPTY)", $(tmp_ml)))
command[] = $(OCamlC) -c -package $(package) $(tmp_ml)
command[] = $(OCamlC) -warn-error -a -c -package $(package) $(tmp_ml)
println($(string $(command)))
# The program
program = $"""(* Configuration file; you can remove this. *)
......@@ -142,7 +159,10 @@ ConfReplaceAt(file)=
stdout = $(fopen $(file), w)
fsubst($(file).in)
case $"@\([A-Z0-9_]+\)@" g
getvar($1)
if $(defined $1)
getvar($1)
else
value false
close($(stdout))
ConfReplaceConfigH(file)=
......@@ -166,27 +186,66 @@ SRCDIR = $(ROOT)/src
################################################################### local build
Subpackages_available(packs) =
sequence-forall($(fun elem, $(mem $(elem), all supported $(SUPPORTED_SUBPACKAGES))), $(packs))
sequence-forall($(fun elem, $(mem $(elem), core all_formats supported $(SUPPORTED_SUBPACKAGES))), $(packs))
BuildExample(namex, modules, packages) =
.PHONY: clean
if $(Subpackages_available $(packages))
subs=core $(packages)
# the library is created with -dllib: no -custom required
OCAML_BYTE_LINK_FLAGS=
OCAML_BYTE_LINK_FLAGS= -linkall
OCAML_NATIVE_LINK_FLAGS= -linkall
OCAMLINCLUDES += $(SRCDIR)
OCAML_LIBS+= $(addprefix $(SRCDIR)/camlimages_, $(subs))
OCAML_BYTE_LINK_FLAGS+=-dllpath $(SRCDIR)
OCAMLPACKS[]+=unix # exif requires unix
export
.DEFAULT: $(OCamlProgram $(namex), $(modules))
else
println(Warning: $(namex) is not built: it requires $(string $(packages)))
# too verbose
# else
# println(Warning: $(namex) is not built: it requires $(string $(packages)))
# println(Warning: Supported: $(string all_formats supported $(SUPPORTED_SUBPACKAGES)))
clean:
rm -f $(filter-proper-targets $(ls R, .))
rm -f $(filter-proper-targets $(ls R, .)) *.cmt* *.sp*t
export
###############################################################################
pkg_config(name, libname) =
ConfMsgChecking(for $(libname) by pkg-config)
if $(and $(defined this.PATH_PKG_CONFIG), $(equal 0, $(shell-code $(PATH_PKG_CONFIG) $(libname))))
# this is required since it is called in .STATIC
setvar(this.LDFLAGS_$(name), $(shell $(PATH_PKG_CONFIG) --libs $(libname)))
setvar(this.CFLAGS_$(name), $(shell $(PATH_PKG_CONFIG) --cflags $(libname)))
setvar(this.SUPPORT_$(uppercase $(name)), true)
setvar(this.HAVE_$(uppercase $(name)), true)
ConfMsgResult(found)
export
value true
else
ConfMsgResult(failed $(PATH_PKG_CONFIG) $(libname))
value false
export
# PATH_PKG_CONFIG must be well defined
pkg_config_version(libname) =
value $(shell $(PATH_PKG_CONFIG) $(libname) --modversion)
pkg_config_between_vers(name, libname, min_ver, too_high_ver) =
if $(pkg_config $(name), $(libname))
ConfMsgChecking($(libname): $(min_ver) <= version < $(too_high_ver))
ver=$(pkg_config_version $(libname))
if $(and $(le $(cmp-versions $(min_ver), $(ver)), 0), $(lt $(cmp-versions $(ver), $(too_high_ver)), 0))
ConfMsgResult($(ver) ... yes)
value true
export
else
ConfMsgResult($(ver) ... no)
value false # do not export
export
else
value false
export
========================================================
CamlImages - Objective Caml image processing library
========================================================
The latest released version is 4.1.3.
========================================================
Note: This library is currently under development.
========================================================
0. What is CamlImages ?
What is CamlImages ?
========================================================