This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository camlimages.

commit 39036dd1b5ad58322c85831cd9873d54bf68b14e
Author: Stephane Glondu <st...@glondu.net>
Date:   Thu Feb 26 16:13:17 2015 +0100

    Imported Upstream version 4.1.2
---
 .hg_archival.txt            |  7 ++--
 Changes.txt                 |  4 +++
 INSTALL.rst                 |  2 +-
 OMakefile                   | 20 +++++++++--
 OMyMakeroot                 | 24 ++++++++++---
 README.rst                  | 86 +++++++++++++++++++++++++++++++++++++++++++--
 examples/gifanim/usleep.ml  |  2 +-
 examples/liv/display.ml     |  2 +-
 examples/liv/jWidget.ml     |  2 +-
 examples/liv/livshtype.ml   |  2 +-
 opam/camlimages.4.0.1/descr |  5 ---
 opam/camlimages.4.0.1/opam  | 10 ------
 opam/camlimages.4.0.1/url   |  1 -
 opam/camlimages.4.0.2/descr |  5 ---
 opam/camlimages.4.0.2/opam  | 19 ----------
 opam/camlimages.4.0.2/url   |  1 -
 opam/camlimages.4.1.0/descr |  5 ---
 opam/camlimages.4.1.0/opam  | 19 ----------
 opam/camlimages.4.1.0/url   |  1 -
 opam/camlimages.4.1.1/descr |  5 ---
 opam/camlimages.4.1.1/opam  | 19 ----------
 opam/camlimages.4.1.1/url   |  1 -
 opam/template/opam          |  2 +-
 src/bmp.ml                  | 12 +++----
 src/cmyk32.mli              |  1 +
 src/exif.ml                 | 15 ++++----
 src/exif.mli                |  2 --
 src/exifanalyze.ml          |  1 -
 src/exifutil.ml             |  2 --
 src/freetype.ml             |  2 +-
 src/gifread.c               | 19 ++++++++--
 src/gifwrite.c              | 24 +++++++++++--
 src/index16.ml              |  1 -
 src/index16.mli             |  1 +
 src/index8.ml               |  1 -
 src/index8.mli              |  1 +
 src/jpeg.ml                 |  2 +-
 src/jpegread.c              |  4 +--
 src/oColor.ml               |  9 -----
 src/oImages.ml              |  4 +--
 src/pngread.c               |  1 +
 src/ppm.ml                  |  4 +--
 src/ps.ml                   |  2 +-
 src/rgb24.mli               |  1 +
 src/rgba32.mli              |  1 +
 45 files changed, 202 insertions(+), 152 deletions(-)

diff --git a/.hg_archival.txt b/.hg_archival.txt
index e52c744..716ad15 100644
--- a/.hg_archival.txt
+++ b/.hg_archival.txt
@@ -1,5 +1,4 @@
 repo: e37886d73a98029822983bee73a2d90ceb4b298b
-node: e4e7c50d80c2160f914a129758023bbdd75d86d3
-branch: 4.1.1
-latesttag: v4.0.1
-latesttagdistance: 83
+node: e70559bc4fcc98a125fee9fc8ced22237faa2d41
+branch: for-release-4.1.2
+tag: 4.1.2
diff --git a/Changes.txt b/Changes.txt
index d5512d6..3b028f2 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -1,3 +1,7 @@
+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
diff --git a/INSTALL.rst b/INSTALL.rst
index e5606df..3febfd9 100644
--- a/INSTALL.rst
+++ b/INSTALL.rst
@@ -7,7 +7,7 @@ Requirements
 
 To install CamlImages library, you need the following softwares:
 
-* OCaml 4.00.1 or higher (OCaml 3.11 and above might work with small trivial 
fixes, but never tested)
+* OCaml 4.01.0 or higher
 * Findlib (aka ocamlfind, 
http://www.camlcity.org/archive/programming/findlib.html )
 * OMake ( http://omake.metaprl.org/index.html )
 
diff --git a/OMakefile b/OMakefile
index 42df7cc..8bdb707 100644
--- a/OMakefile
+++ b/OMakefile
@@ -14,6 +14,19 @@
 
 include OMyMakeroot
 
+############################################################## Warnings
+
+# For release, -warn-error should not be put
+
+# OCaml 4.01.0
+# OCAMLFLAGS= -w A-4-9-40-42-44-45
+OCAMLFLAGS= -w A-4-9-40-42-44-45-37-41-35
+
+# For the development, -warn-error A is turned on
+if $(file-exists DEV)
+   OCAMLFLAGS += -warn-error A
+   export
+
 ########################################## External arguments
 
 # Specify directories where X's rgb.txt can be found
@@ -23,7 +36,7 @@ PATH_RGB_TXT[]=
 
 ########################################################################
 
-VERSION=4.1.1
+VERSION=4.1.2
 
 # for src/META
 PACKAGE_NAME=camlimages
@@ -145,7 +158,7 @@ print_configured() =
   LDFLAGS_gif=
   SUPPORT_GIF=false 
   if $(true_if_not_defined ARG_WANT_GIF)
-    if $(not $(pkg_config gif, libgif))
+    if $(not $(pkg_config_between_vers gif, libgif, 4.0.0, 5.0.0))
       HAVE_GIF = $(Check_header_library gif, gif_lib.h, DGifOpenFileName)
       SUPPORT_GIF = $(HAVE_GIF)
       if $(SUPPORT_GIF)
@@ -164,7 +177,8 @@ print_configured() =
   LDFLAGS_png=
   SUPPORT_PNG=false 
   if $(true_if_not_defined ARG_WANT_PNG)
-    res=$(pkg_config png, libpng) # we need a separate statement to get the 
vars defined in pkg_config reflected.
+    # we need a separate statement to get the vars defined in pkg_config 
reflected.
+    res=$(pkg_config png, libpng)
     if $(not $(res))
       HAVE_PNG = $(Check_header_library png, png.h, png_create_read_struct)
       SUPPORT_PNG = $(and $(HAVE_Z) $(HAVE_PNG))
diff --git a/OMyMakeroot b/OMyMakeroot
index b49c87a..7d2cfd3 100644
--- a/OMyMakeroot
+++ b/OMyMakeroot
@@ -55,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)
@@ -230,3 +226,23 @@ pkg_config(name, libname) =
     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
diff --git a/README.rst b/README.rst
index 9e836e1..b3b1ec9 100644
--- a/README.rst
+++ b/README.rst
@@ -2,7 +2,7 @@
 CamlImages - Objective Caml image processing library
 ========================================================
 
-The latest released version is 4.1.0.
+The latest released version is 4.1.2.
 ========================================================
 
 Note: This library is currently under development.
@@ -22,7 +22,7 @@ Installation
 
 Read the file INSTALL.txt
 
-Using CamlImages
+CamlImages concepts
 ========================================================
 
 Color models
@@ -120,6 +120,88 @@ when the program exits successfully. In other situations, 
for instance
 in case of spurious exception, you may need to erase temporary files
 manually.
 
+Use of CamlImages
+====================================
+
+OCamlFind
+------------------------------------
+
+Due to the library complexity, we recommend using OCamlFind.
+You can get the list of related packages by::
+
+    $ ocamlfind list | grep camlimages
+    camlimages          (version: 4.1.2)
+    camlimages.all      (version: 4.1.2)
+    camlimages.all_formats (version: 4.1.2)
+    camlimages.core     (version: 4.1.2)
+    camlimages.exif     (version: 4.1.2)
+    camlimages.freetype (version: 4.1.2)
+    camlimages.gif      (version: 4.1.2)
+    camlimages.graphics (version: 4.1.2)
+    camlimages.jpeg     (version: 4.1.2)
+    camlimages.lablgtk2 (version: 4.1.2)
+    camlimages.png      (version: 4.1.2)
+    camlimages.ps       (version: 4.1.2)
+    camlimages.tiff     (version: 4.1.2)
+    camlimages.xpm      (version: 4.1.2)
+ 
+After successful installation of CamlImages, you should see something similar 
above.
+At compilation of your program, you should list the packages of image formats 
and GUI of you needs.
+But if you are not sure which one is required, just use 'camlimages.all':
+it contains everything. Normally your compilation command should look like::
+
+    $ ocamlfind ocamlc -c -package camlimages.all blah.ml
+
+to compile a module using CamlImages, or to build an executable,::
+
+    $ ocamlfind ocamlc -linkpkg -package camlimages.all blah.ml
+
+Basic image manipulation
+--------------------------------------
+
+We have a basic image manipulation modules for each image pixel type:
+Index8, Index16, Rgb24, Rgba32 and Cmyk32. All they have the same interface
+documented in Image_intf.IMAGE.
+
+Image saving/loading
+--------------------------------------
+
+To save or load an image to some image format, use the corresponding module
+for the image format. Jpeg, Gif, Png and so on.
+
+Here is a simple code to create a 1x1 RGB24 image and save it to a jpeg file::
+
+    (* save it to sample.ml *)
+    let () =
+      let img = Rgb24.create 1 1 in
+      Rgb24.set img 0 0 { Color.r = 255; g = 0; b = 0 };
+      Jpeg.save "sample.jpg" [] (Images.Rgb24 img)
+
+You should be able to compile it by::
+
+    $ ocamlfind ocamlc -linkpkg -package camlimages.all -o sample sample.ml
+
+and "./sample" should create an image file "sample.jpg". 
+(To run the code correctly, your CamlImages must be compiled with JPEG 
library.)
+
+Examples
+--------------------------------------
+
+Some one-ML-file examples are found in CamlImages source directory. 
+Here are some recommendations:
+
+* examples/edgedetect : Good to learn basic image loading/saving and pixel 
color manipulation
+* examples/imgstat : Image header check which is written in pure OCaml code.
+* tests/test.ml : Various image load/save tests displaying them on OCaml's 
Graphics window.
+* examples/gifanim : How to handle Gif animation frames and how to write 
LablGtk app
+* examples/resize : Resizing image
+
+You can normally compile them by::
+
+    $ ocamlfind ocamlc -linkpkg -package camlimages.all -o XXX XXX.ml
+
+Some may just fail because some of required libraries are not found in your 
system.
+
 Where to report issues?
 ==========================================================
 
diff --git a/examples/gifanim/usleep.ml b/examples/gifanim/usleep.ml
index 0e05bad..e2efb62 100644
--- a/examples/gifanim/usleep.ml
+++ b/examples/gifanim/usleep.ml
@@ -12,5 +12,5 @@
 
 (* $Id: usleep.ml,v 1.4 2004/09/23 06:56:23 weis Exp $ *)
 
-let rec usleep sec = ignore (Unix.select [] [] [] sec);;
+let usleep sec = ignore (Unix.select [] [] [] sec);;
 
diff --git a/examples/liv/display.ml b/examples/liv/display.ml
index 10ab52a..875a966 100644
--- a/examples/liv/display.ml
+++ b/examples/liv/display.ml
@@ -264,7 +264,7 @@ let resize w h cond old =
 let create_pixbuf (_id : int) image filters =
   let pixbuf = Imagegdk.to_pixbuf image in
   let filters = sort_filters filters in
-  let rec filter_pixbuf pixbuf = function
+  let filter_pixbuf pixbuf = function
     | [] -> pixbuf
     | `SIZE (w, h, cond) :: _fs -> 
        (* original pixbuf will be GC'ed automatically *)
diff --git a/examples/liv/jWidget.ml b/examples/liv/jWidget.ml
index 8e6b07a..fabf26c 100644
--- a/examples/liv/jWidget.ml
+++ b/examples/liv/jWidget.ml
@@ -82,7 +82,7 @@ end
 
 let status_bar ?packing ?show () = new status_bar ?packing ?show ()
 
-class img_button ?label ?frames ?border_width ?width ?height ?packing ?show () 
=
+class img_button ?label ?frames ?packing ?show () =
   let button = GButton.button (*?border_width ?width ?height*) ?packing ?show 
() in
   let vbox = GPack.vbox ~packing: button#add () in
   let pix = 
diff --git a/examples/liv/livshtype.ml b/examples/liv/livshtype.ml
index 5c5a5d9..6f3fbaf 100644
--- a/examples/liv/livshtype.ml
+++ b/examples/liv/livshtype.ml
@@ -123,7 +123,7 @@ let guess link_as_link f =
     end;;
 
 let guess = guess false
-and lguess = guess true;;
+and _lguess = guess true;;
 
 (* prerr_endline "reading suffix"; *)
 read_suffix_file default_mime_types;;
diff --git a/opam/camlimages.4.0.1/descr b/opam/camlimages.4.0.1/descr
deleted file mode 100644
index cba695b..0000000
--- a/opam/camlimages.4.0.1/descr
+++ /dev/null
@@ -1,5 +0,0 @@
-Image processing library
-An image processing library, which provides loading and saving various
-image formats with an interface for the Caml graphics library. It has
-also an interface with the freetype library to draw texts using
-truetype fonts.
diff --git a/opam/camlimages.4.0.1/opam b/opam/camlimages.4.0.1/opam
deleted file mode 100644
index 3837b12..0000000
--- a/opam/camlimages.4.0.1/opam
+++ /dev/null
@@ -1,10 +0,0 @@
-opam-version: "1"
-maintainer: "jun.fur...@gmail.com"
-build: [
-  ["omake"]
-  ["omake" "install"]
-]
-remove: [
-  ["ocamlfind" "remove" "camlimages"]
-]
-depends: ["ocamlfind" "lablgtk" "omake"]
diff --git a/opam/camlimages.4.0.1/url b/opam/camlimages.4.0.1/url
deleted file mode 100644
index 91718b5..0000000
--- a/opam/camlimages.4.0.1/url
+++ /dev/null
@@ -1 +0,0 @@
-archive: "https://bitbucket.org/camlspotter/camlimages/get/v4.0.1.tar.gz";
diff --git a/opam/camlimages.4.0.2/descr b/opam/camlimages.4.0.2/descr
deleted file mode 100644
index cba695b..0000000
--- a/opam/camlimages.4.0.2/descr
+++ /dev/null
@@ -1,5 +0,0 @@
-Image processing library
-An image processing library, which provides loading and saving various
-image formats with an interface for the Caml graphics library. It has
-also an interface with the freetype library to draw texts using
-truetype fonts.
diff --git a/opam/camlimages.4.0.2/opam b/opam/camlimages.4.0.2/opam
deleted file mode 100644
index 571cdcc..0000000
--- a/opam/camlimages.4.0.2/opam
+++ /dev/null
@@ -1,19 +0,0 @@
-opam-version: "1"
-maintainer: "jun.fur...@gmail.com"
-build: [
-  ["omake"]
-  ["omake" "install"]
-]
-remove: [
-  ["ocamlfind" "remove" "camlimages"]
-]
-depends: ["ocamlfind" "omake"]
-depopts: ["lablgtk"]
-
-homepage: "http://cristal.inria.fr/camlimages/";
-license: "LGPL-2 with OCaml linking exception"
-authors: [
-  "Jun Furuse"
-  "François Pessaux"
-  "Pierre Weis"
-]
diff --git a/opam/camlimages.4.0.2/url b/opam/camlimages.4.0.2/url
deleted file mode 100644
index 80e66f8..0000000
--- a/opam/camlimages.4.0.2/url
+++ /dev/null
@@ -1 +0,0 @@
-archive: "https://bitbucket.org/camlspotter/camlimages/get/4.0.2.tar.gz";
diff --git a/opam/camlimages.4.1.0/descr b/opam/camlimages.4.1.0/descr
deleted file mode 100644
index cba695b..0000000
--- a/opam/camlimages.4.1.0/descr
+++ /dev/null
@@ -1,5 +0,0 @@
-Image processing library
-An image processing library, which provides loading and saving various
-image formats with an interface for the Caml graphics library. It has
-also an interface with the freetype library to draw texts using
-truetype fonts.
diff --git a/opam/camlimages.4.1.0/opam b/opam/camlimages.4.1.0/opam
deleted file mode 100644
index dafade2..0000000
--- a/opam/camlimages.4.1.0/opam
+++ /dev/null
@@ -1,19 +0,0 @@
-opam-version: "1"
-maintainer: "jun.fur...@gmail.com"
-build: [
-  ["omake" "--configure" "INCLUDES=/usr/include/libexif"]
-  ["omake" "install"]
-]
-remove: [
-  ["ocamlfind" "remove" "camlimages"]
-]
-depends: ["ocamlfind" "base-unix" "omake"]
-depopts: ["lablgtk"]
-
-homepage: "http://cristal.inria.fr/camlimages/";
-license: "LGPL-2 with OCaml linking exception"
-authors: [
-  "Jun Furuse"
-  "François Pessaux"
-  "Pierre Weis"
-]
diff --git a/opam/camlimages.4.1.0/url b/opam/camlimages.4.1.0/url
deleted file mode 100644
index faf7a87..0000000
--- a/opam/camlimages.4.1.0/url
+++ /dev/null
@@ -1 +0,0 @@
-archive: "https://bitbucket.org/camlspotter/camlimages/get/4.1.0.tar.gz";
diff --git a/opam/camlimages.4.1.1/descr b/opam/camlimages.4.1.1/descr
deleted file mode 100644
index cba695b..0000000
--- a/opam/camlimages.4.1.1/descr
+++ /dev/null
@@ -1,5 +0,0 @@
-Image processing library
-An image processing library, which provides loading and saving various
-image formats with an interface for the Caml graphics library. It has
-also an interface with the freetype library to draw texts using
-truetype fonts.
diff --git a/opam/camlimages.4.1.1/opam b/opam/camlimages.4.1.1/opam
deleted file mode 100644
index ca795cc..0000000
--- a/opam/camlimages.4.1.1/opam
+++ /dev/null
@@ -1,19 +0,0 @@
-opam-version: "1"
-maintainer: "jun.fur...@gmail.com"
-build: [
-  ["omake" "--configure"]
-  ["omake" "install"]
-]
-remove: [
-  ["ocamlfind" "remove" "camlimages"]
-]
-depends: ["ocamlfind" "base-unix" "omake"]
-depopts: ["lablgtk"]
-ocaml-version: [>= "4.00.1"]
-homepage: "https://bitbucket.org/camlspotter/camlimages";
-license: "LGPL-2 with OCaml linking exception"
-authors: [
-  "Jun Furuse"
-  "François Pessaux"
-  "Pierre Weis"
-]
diff --git a/opam/camlimages.4.1.1/url b/opam/camlimages.4.1.1/url
deleted file mode 100644
index c2a4c93..0000000
--- a/opam/camlimages.4.1.1/url
+++ /dev/null
@@ -1 +0,0 @@
-archive: "https://bitbucket.org/camlspotter/camlimages/get/4.1.1.tar.gz";
diff --git a/opam/template/opam b/opam/template/opam
index ca795cc..9000b5a 100644
--- a/opam/template/opam
+++ b/opam/template/opam
@@ -9,7 +9,7 @@ remove: [
 ]
 depends: ["ocamlfind" "base-unix" "omake"]
 depopts: ["lablgtk"]
-ocaml-version: [>= "4.00.1"]
+ocaml-version: [>= "4.01.0"]
 homepage: "https://bitbucket.org/camlspotter/camlimages";
 license: "LGPL-2 with OCaml linking exception"
 authors: [
diff --git a/src/bmp.ml b/src/bmp.ml
index 95d5738..3c3b52d 100644
--- a/src/bmp.ml
+++ b/src/bmp.ml
@@ -276,7 +276,7 @@ let load_image8data bih ic =
                (* Absolute mode:
                   c represents the number of bytes which follow,
                   each of which contains the color index of a single pixel. *)
-               for i = 0 to c - 1 do
+               for _i = 0 to c - 1 do
                  let c1 = read_byte ic in
                  bitmap.[!bitmapindex] <- Char.chr c1;
                  incr x;
@@ -288,7 +288,7 @@ let load_image8data bih ic =
        | c ->
            (* Encoded mode *)
            let c1 = read_byte ic in
-           for i = 0 to c - 1 do
+           for _i = 0 to c - 1 do
              bitmap.[!bitmapindex] <- Char.chr c1;
              incr x;
              incr bitmapindex
@@ -417,13 +417,13 @@ let load_image24data bih ic =
   let pp = ref 0 in
   for i = bih.biHeight - 1 downto 0 do
     pp := (i * bih.biWidth * 3);
-    for j = 0 to bih.biWidth - 1 do
+    for _j = 0 to bih.biWidth - 1 do
       bitmap.[!pp + 2] <- Char.chr (read_byte ic);   (* Blue *)
       bitmap.[!pp + 1] <- Char.chr (read_byte ic);   (* Green *)
       bitmap.[!pp] <- Char.chr (read_byte ic);     (* Red *)
       pp := !pp + 3
     done;
-    for j = 0 to pad - 1 do skip_byte ic done;
+    for _j = 0 to pad - 1 do skip_byte ic done;
   done;
   bitmap
 ;;
@@ -438,7 +438,7 @@ let load_image32data bih ic =
   let pp = ref 0 in
   for i = bih.biHeight - 1 downto 0 do
     pp := (i * bih.biWidth * 4);
-    for j = 0 to bih.biWidth - 1 do
+    for _j = 0 to bih.biWidth - 1 do
       bitmap.[!pp + 2] <- Char.chr (read_byte ic);   (* Blue *)
       bitmap.[!pp + 1] <- Char.chr (read_byte ic);   (* Green *)
       bitmap.[!pp + 0] <- Char.chr (read_byte ic);   (* Red *)
@@ -646,7 +646,7 @@ let write_end_of_scan_line oc = write_byte oc 0; write_byte 
oc 0;;
 let write_end_of_bitmap oc = write_byte oc 0; write_byte oc 1;;
 
 (* Writing padding bytes. *)
-let write_pad oc n = for i = 0 to n - 1 do write_byte oc 0 done;;
+let write_pad oc n = for _i = 0 to n - 1 do write_byte oc 0 done;;
 
 (* Run length encoding: write the number n of pixels encoded *)
 (* the color number given by color index c *)
diff --git a/src/cmyk32.mli b/src/cmyk32.mli
index 50e5355..6796a4a 100644
--- a/src/cmyk32.mli
+++ b/src/cmyk32.mli
@@ -54,3 +54,4 @@ val make : int -> int -> elt -> t;;
 val copy : t -> t;;
 val sub : t -> int -> int -> int -> int -> t;;
 val resize : (float -> unit) option -> t -> int -> int -> t;;
+val rawimage : t -> rawimage
diff --git a/src/exif.ml b/src/exif.ml
index 43fea1e..5ed0af4 100644
--- a/src/exif.ml
+++ b/src/exif.ml
@@ -103,12 +103,12 @@ module DateTime = struct
       let converter sec =
         let open Unix in
         let tm = Unix.gmtime sec in
-        { year  = tm.Unix.tm_year;
-          month = tm.Unix.tm_mon + 1;
-          day   = tm.Unix.tm_mday;
-          hour  = tm.Unix.tm_hour;
-          min   = tm.Unix.tm_min;
-          sec   = tm.Unix.tm_sec }
+        { year  = tm.tm_year;
+          month = tm.tm_mon + 1;
+          day   = tm.tm_mday;
+          hour  = tm.tm_hour;
+          min   = tm.tm_min;
+          sec   = tm.tm_sec }
         in
       if s.[4] = '\000' then
         let sec = 
@@ -397,7 +397,6 @@ module Analyze = struct
   *)
   
   open Numbers
-  open IFD
   open Entry.Pack
   
   type datetime = 
@@ -456,6 +455,7 @@ module Analyze = struct
   
     | _ -> `Unknown (tag, pack)
   
+(* CR jfuruse: unused
   module GPS = struct
     type latitude = [ `North | `South ] * rational
     type longitude = [ `East | `West ] * rational
@@ -478,6 +478,7 @@ module Analyze = struct
       map_datum      : map_datum option
     }
   end
+*)
         
   let analyze_gps (tag, v) = match tag, v with
       
diff --git a/src/exif.mli b/src/exif.mli
index 31a322d..84d1699 100644
--- a/src/exif.mli
+++ b/src/exif.mli
@@ -7,8 +7,6 @@ module Numbers : sig
   val string_of_srational : int32 -> int32 -> string
 end
 
-open Numbers
-
 module Endian : sig
   type t = Big | Little 
   val to_string : t -> string 
diff --git a/src/exifanalyze.ml b/src/exifanalyze.ml
index 42f4dd2..1b86d40 100644
--- a/src/exifanalyze.ml
+++ b/src/exifanalyze.ml
@@ -9,7 +9,6 @@ open Exifutil
 
 open Exif
 open Exif.Numbers
-open Exif.IFD
 open Exif.Entry.Pack
 
 (* I have some photos from my old Android with non Ascii datetime.
diff --git a/src/exifutil.ml b/src/exifutil.ml
index 6517690..f3d403b 100644
--- a/src/exifutil.ml
+++ b/src/exifutil.ml
@@ -1,5 +1,3 @@
-open Format
-
 module Format = struct
   include Format
 
diff --git a/src/freetype.ml b/src/freetype.ml
index 2f3cff0..92e212f 100644
--- a/src/freetype.ml
+++ b/src/freetype.ml
@@ -45,7 +45,7 @@ let done_face face = Ftlow.done_face face.cont;;
 let new_face t font idx =
   let face = {cont = Ftlow.new_face t.cont font idx; ref = ref t} in
   let info = Ftlow.face_info face.cont in
-  Gc.finalise (fun v -> Ftlow.done_face v.cont) face;
+  Gc.finalise done_face face;
   face, info;;
 
 let get_num_glyphs face = Ftlow.get_num_glyphs face.cont;;
diff --git a/src/gifread.c b/src/gifread.c
index 3fb2e65..920caa8 100644
--- a/src/gifread.c
+++ b/src/gifread.c
@@ -27,6 +27,11 @@
 
 #include <gif_lib.h>
 
+// GIFLIB_MAJOR is only defined in libgif >= 4.2.0
+#if !defined(GIFLIB_MAJOR)
+#  define GIFLIB_MAJOR 4
+#endif
+
 value Val_GifColorType( GifColorType *color )
 {
   CAMLparam0();
@@ -140,7 +145,13 @@ value dGifOpenFileName( value name )
   GifFileType *GifFile;
   int i;
 
-  if((GifFile = DGifOpenFileName( String_val(name) )) == NULL){
+#if (GIFLIB_MAJOR <= 4)
+    GifFile = DGifOpenFileName( String_val(name) );
+#else
+    GifFile = DGifOpenFileName( String_val(name), NULL);
+#endif
+
+  if(GifFile == NULL){
     failwith("DGifOpenFileName");
   }
 
@@ -161,7 +172,11 @@ void dGifCloseFile( value hdl )
      segmentation faults */
   ((GifFileType *)hdl)->Image.ColorMap = NULL; 
 
-  DGifCloseFile( (GifFileType *) hdl );
+#if (GIFLIB_MAJOR <= 4)
+  DGifCloseFile( (GifFileType *) hdl);
+#else
+  DGifCloseFile( (GifFileType *) hdl, NULL );
+#endif
   CAMLreturn0;
 }
 
diff --git a/src/gifwrite.c b/src/gifwrite.c
index 8980623..a9b838c 100644
--- a/src/gifwrite.c
+++ b/src/gifwrite.c
@@ -25,6 +25,11 @@
 
 #include <gif_lib.h>
 
+// GIFLIB_MAJOR is only defined in libgif >= 4.2.0
+#if !defined(GIFLIB_MAJOR)
+#  define GIFLIB_MAJOR 4
+#endif
+
 int list_length( value list )
 {
   CAMLparam1(list);
@@ -51,7 +56,12 @@ ColorMapObject *ColorMapObject_val( value cmap )
 fprintf(stderr, "Creating map with length = %d ...\n", len);
 fflush(stderr);
 */
-  cmapobj = MakeMapObject( len, NULL );
+#if (GIFLIB_MAJOR == 4)
+    cmapobj = MakeMapObject( len, NULL );
+#else
+    cmapobj = GifMakeMapObject( len, NULL );
+#endif
+
   for(i=0; i< len; i++){
     cmapobj->Colors[i].Red   = Int_val(Field(Field(cmap,i),0));
     cmapobj->Colors[i].Green = Int_val(Field(Field(cmap,i),1));
@@ -67,7 +77,13 @@ value eGifOpenFileName( name )
 
   GifFileType *GifFileOut;
 
-  if ((GifFileOut = EGifOpenFileName( String_val( name ), 0) )== NULL) {
+#if (GIFLIB_MAJOR <= 4)
+    GifFileOut = EGifOpenFileName( String_val( name ), 0 );
+#else
+    GifFileOut = EGifOpenFileName( String_val( name ), 0, NULL );
+#endif
+
+  if (GifFileOut == NULL) {
     failwith("EGifOpenFileName");
   }
   /* gcc -fwritable-strings is required to compile libungif */
@@ -87,7 +103,11 @@ void eGifCloseFile( value hdl )
      segmentation faults */
   ((GifFileType *)hdl)->Image.ColorMap = NULL; 
 
+#if (GIFLIB_MAJOR <= 4)
   EGifCloseFile( (GifFileType *) hdl );
+#else
+  EGifCloseFile( (GifFileType *) hdl, NULL );
+#endif
   CAMLreturn0;
 }
 
diff --git a/src/index16.ml b/src/index16.ml
index 1d63ed9..5c39da0 100644
--- a/src/index16.ml
+++ b/src/index16.ml
@@ -15,7 +15,6 @@
 (* $Id: index16.ml,v 1.4 2009/07/04 03:39:28 furuse Exp $*)
 
 module E = struct
-  open Color
   type t = int
   let bytes_per_pixel = 2
   let get str pos =
diff --git a/src/index16.mli b/src/index16.mli
index 94d85c1..bf9406c 100644
--- a/src/index16.mli
+++ b/src/index16.mli
@@ -67,3 +67,4 @@ val create : int -> int -> t;;
 val make : int -> int -> elt -> t;;
 val copy : t -> t;;
 val sub : t -> int -> int -> int -> int -> t;;
+val rawimage : t -> rawimage
diff --git a/src/index8.ml b/src/index8.ml
index 79f1faa..ae18a91 100644
--- a/src/index8.ml
+++ b/src/index8.ml
@@ -15,7 +15,6 @@
 (* $Id: index8.ml,v 1.4 2009/07/04 03:39:28 furuse Exp $*)
 
 module E = struct
-  open Color
   type t = int
   let bytes_per_pixel = 1
   let get str pos =
diff --git a/src/index8.mli b/src/index8.mli
index 3049165..3581654 100644
--- a/src/index8.mli
+++ b/src/index8.mli
@@ -67,3 +67,4 @@ val create : int -> int -> t;;
 val make : int -> int -> elt -> t;;
 val copy : t -> t;;
 val sub : t -> int -> int -> int -> int -> t;;
+val rawimage : t -> rawimage
diff --git a/src/jpeg.ml b/src/jpeg.ml
index 2581ac8..d019ff1 100644
--- a/src/jpeg.ml
+++ b/src/jpeg.ml
@@ -223,7 +223,7 @@ let save_cmyk_sample name opts =
   done;
   close_out oc;;
 
-let rec find_jpeg_size ic =
+let find_jpeg_size ic =
   (* jump to the next 0xff *)
   let rec loop () =
     let rec jump_to_0xff () =
diff --git a/src/jpegread.c b/src/jpegread.c
index 6fa5cea..d7b77f1 100644
--- a/src/jpegread.c
+++ b/src/jpegread.c
@@ -2,7 +2,7 @@
 /*                                                                     */
 /*                           Objective Caml                            */
 /*                                                                     */
-/*            Fran�ois Pessaux, projet Cristal, INRIA Rocquencourt     */
+/*            Fran輟is Pessaux, projet Cristal, INRIA Rocquencourt     */
 /*            Pierre Weis, projet Cristal, INRIA Rocquencourt          */
 /*            Jun Furuse, projet Cristal, INRIA Rocquencourt           */
 /*                                                                     */
@@ -286,7 +286,7 @@ value jpegh, offset, buf;
 }
 
 /* no boundary checks */
-value read_jpeg_scanlines( value jpegh, value buf, value offset, value lines )
+void read_jpeg_scanlines( value jpegh, value buf, value offset, value lines )
 {
   CAMLparam4(jpegh,offset,buf,lines);
   struct jpeg_decompress_struct *cinfop;
diff --git a/src/oColor.ml b/src/oColor.ml
index bcd83a3..a070333 100644
--- a/src/oColor.ml
+++ b/src/oColor.ml
@@ -18,15 +18,6 @@
 
 open Color;;
 
-module type COLORMAP = sig
-  type t
-  val size : t map -> int
-  val find_exact : t map -> t -> int
-  val add_color : t map -> t -> int
-  val add_colors : t map -> t list -> int list
-  val find_nearest : t map -> t -> int
-end;;
-
 class virtual ['a] map (cmap : 'a Color.map) = object
   val mapobj = cmap
   method colormap = mapobj
diff --git a/src/oImages.ml b/src/oImages.ml
index 69a2d7c..e8159ea 100644
--- a/src/oImages.ml
+++ b/src/oImages.ml
@@ -228,7 +228,7 @@ end;;
 
 class index8_wrapper img = object (self)
   inherit oimage_impl
-  inherit OColor.rgbmap img.colormap as colormap
+  inherit OColor.rgbmap img.colormap
 
   method image_class = ClassIndex8
   method image = Index8 img
@@ -298,7 +298,7 @@ end;;
 
 class index16_wrapper img = object (self)
   inherit oimage_impl
-  inherit OColor.rgbmap img.colormap as colormap
+  inherit OColor.rgbmap img.colormap
 
   method image_class = ClassIndex16
   method image = Index16 img
diff --git a/src/pngread.c b/src/pngread.c
index 32447fd..c24c686 100644
--- a/src/pngread.c
+++ b/src/pngread.c
@@ -18,6 +18,7 @@
 #include "config.h"
 #endif
 
+#include "string.h"
 #include "oversized.h"
 #include <png.h>
 
diff --git a/src/ppm.ml b/src/ppm.ml
index 5c8a8fe..a9d3383 100644
--- a/src/ppm.ml
+++ b/src/ppm.ml
@@ -55,7 +55,7 @@ let string_of_magic_number = function
   | P6 -> "P6";;
 
 (* Auxiliaries: skipping comments and reading numbers into strings. *)
-let rec skip_comment ic =
+let skip_comment ic =
  let rec r0 () =
   match input_char ic with
   | '#' -> r1 ()
@@ -209,7 +209,7 @@ let rec read_ascii_bit ic =
 
 let read_ascii_pbm_ic ic l c = read_raw_gen_ic read_ascii_bit ic l c max_byte;;
 
-let rec read_ppm_ic ic =
+let read_ppm_ic ic =
  let mn, l, c = read_ppm_header ic in
  let img =
    match mn with
diff --git a/src/ps.ml b/src/ps.ml
index 2a96e18..bd26fe1 100644
--- a/src/ps.ml
+++ b/src/ps.ml
@@ -311,7 +311,7 @@ let super_save file conf comments showpage images =
                    (Char.code buf.[adrs])
                    (Char.code buf.[adrs + 1])
                    (Char.code buf.[adrs + 2]) in
-                for i = 0 to 2 do
+                for _i = 0 to 2 do
                   p_ (sprintf "%02x" m)
                 done in
           if not conf.mirror then
diff --git a/src/rgb24.mli b/src/rgb24.mli
index 164de28..c862153 100644
--- a/src/rgb24.mli
+++ b/src/rgb24.mli
@@ -65,3 +65,4 @@ val copy : t -> t;;
 val sub : t -> int -> int -> int -> int -> t;;
 val dump : t -> string;;
 val unsafe_access : t -> int -> int -> string * int;;
+val rawimage : t -> rawimage
diff --git a/src/rgba32.mli b/src/rgba32.mli
index 47dd8a3..e23ab74 100644
--- a/src/rgba32.mli
+++ b/src/rgba32.mli
@@ -58,3 +58,4 @@ val create : int -> int -> t;;
 val make : int -> int -> elt -> t;;
 val copy : t -> t;;
 val sub : t -> int -> int -> int -> int -> t;;
+val rawimage : t -> rawimage

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-ocaml-maint/packages/camlimages.git

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to