[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#404395: libcamlimages-ocaml-dev: Fails to load images.



Hello,

In gmane.linux.debian.devel.ocaml, you wrote:
> The simplest program (load_image.ml) using camlimages:
>
>     let _ =
> 	    let filename = Sys.argv.(1) in
> 	    let img = OImage.load filename [] in
> 	    let img = OImage.rgb24 img in
> 	    ignore img
>

You should use OImages in place of OImage.

> and compiled with:
>
>     ocamlopt -o load_image -I +camlimages camlimages.cmx region.cmx tmpfile.cmx bitmap.cmx \
> 		genimage.cmx cmyk32.cmx rgba32.cmx rgb24.cmx mstring.cmx color.cmx index8.cmx \
> 		index16.cmx images.cmx oColor.cmx oImage.cmx load_image.ml
>

Really, you should use :
ocamlfind -package camlimages -linkpkg -o load_image load_image.ml

But anyway, take a look at your command line. You don't load anything
dealing with png or jpeg... It should have made you think there was a
problem.

Using ocamlfind, load everything, and seems to work as expected. 

> and then run with:
>
>     ./load_image <somefile>
>
> always fails with the following message:
>
>     Fatal error: exception Images.Wrong_file_type
>
> regardless of the type of the file or even if the file doesn't exist.
>
>

Well, in fact, i need to do some patching in my META.camlimages to made
this example work, i open a bug with the good META.camlimages.

Regards,
Sylvain Le Gall



Reply to: