From ef6bb989514ea64be4f6c08b03bcab6fc236705a Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Mon, 28 Jun 2021 23:10:06 +0300 Subject: [PATCH] hotfix: Disable camlimages (#48) * hotfix: Temporarily disable camlimages * hotfix: disable camlimages * hotfix: Temprorary disable support of jpeg and xpm * Remove camlimages completely * Update README --- README.md | 10 +- bin/Main.re | 3 +- bin/ODiffBin.re | 2 +- esy.lock/index.json | 160 +++++----------------------- esy.lock/opam/base.v0.14.1/opam | 36 ------- esy.lock/opam/camlimages.5.0.4/opam | 32 ------ esy.lock/opam/sexplib0.v0.14.0/opam | 26 ----- esy.lock/opam/stdio.v0.14.0/opam | 27 ----- io/CamlImagesIO.re | 73 ------------- io/dune | 2 +- package.json | 27 +++-- 11 files changed, 43 insertions(+), 355 deletions(-) delete mode 100644 esy.lock/opam/base.v0.14.1/opam delete mode 100644 esy.lock/opam/camlimages.5.0.4/opam delete mode 100644 esy.lock/opam/sexplib0.v0.14.0/opam delete mode 100644 esy.lock/opam/stdio.v0.14.0/opam delete mode 100644 io/CamlImagesIO.re diff --git a/README.md b/README.md index ef9ca263..7a949822 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,17 @@ ODiff is a blazing fast native image comparison tool. Check [benchmarks](#benchm ## Features -- ✅ .png, .jpg, .jpeg, .bmp, .tiff, .xpm – Files supported. - ✅ Cross-format comparison - Yes .jpg vs .png comparison without any problems. - ✅ Supports comparison of images with different layouts. - ✅ Anti-aliasing detection - ✅ Ignoring regions - ✅ Using [YIQ NTSC transmission algorithm](http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf) to determine visual difference. -- ✅ No dependencies for `.png` comparison. Only several system C dependencies for other formats, [more info](#lib-dependencies). +- ✅ No dependencies for `.png` comparison ### Coming in the nearest future: +- ⏹ Support different image formats `.jpeg`, `.tiff` and `.bmp` - ⏹ Reading image from memory buffer - ⏹ Reading images from url @@ -144,12 +144,6 @@ Then give it a try 👀 ``` odiff --help ``` - -### lib* dependencies - -Make sure if you want to compare **other** than `.png` images it is required to install the proper C library for each format. For `.jpg` – [libjpg](http://libjpeg.sourceforge.net/), for `.tiff` –[libtiff](http://www.libtiff.org/), for `.xpm` - libxpm. - -`.png` images works out of the box. ### MacOS diff --git a/bin/Main.re b/bin/Main.re index bffcd2c0..5f4a08d4 100644 --- a/bin/Main.re +++ b/bin/Main.re @@ -9,7 +9,8 @@ let getIOModule = (filename, ~antialiasing) => (module ODiffIO.PureC_IO_Bigarray.IO): (module ImageIO) ) | ".png" => ((module ODiffIO.PureC_IO.IO): (module ImageIO)) - | _ => ((module ODiffIO.CamlImagesIO.IO): (module ImageIO)) + | unsupportedFormat => + failwith("This format is not supported: " ++ unsupportedFormat) ); type diffResult('output) = { diff --git a/bin/ODiffBin.re b/bin/ODiffBin.re index 67cedcc0..04ffee22 100644 --- a/bin/ODiffBin.re +++ b/bin/ODiffBin.re @@ -132,7 +132,7 @@ let cmd = { ), Term.info( "odiff", - ~version="2.4.0", + ~version="2.4.1", ~doc="Find difference between 2 images.", ~exits=[ Term.exit_info(0, ~doc="on image match"), diff --git a/esy.lock/index.json b/esy.lock/index.json index 5def2144..d28c15e3 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,15 +1,15 @@ { - "checksum": "908eb7c8e8877458d5287d4a2bef2762", + "checksum": "35802311f4c4a055670932f974b9f2fe", "root": "odiff@link-dev:./package.json", "node": { - "yargs-parser@20.2.7@d41d8cd9": { - "id": "yargs-parser@20.2.7@d41d8cd9", + "yargs-parser@20.2.9@d41d8cd9": { + "id": "yargs-parser@20.2.9@d41d8cd9", "name": "yargs-parser", - "version": "20.2.7", + "version": "20.2.9", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz#sha1:61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" + "archive:https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#sha1:2eb7dc3b0289718fc295f362753845c41a0c94ee" ] }, "overrides": [], @@ -28,7 +28,7 @@ }, "overrides": [], "dependencies": [ - "yargs-parser@20.2.7@d41d8cd9", "y18n@5.0.8@d41d8cd9", + "yargs-parser@20.2.9@d41d8cd9", "y18n@5.0.8@d41d8cd9", "string-width@4.2.2@d41d8cd9", "require-directory@2.1.1@d41d8cd9", "get-caller-file@2.0.5@d41d8cd9", "escalade@3.1.1@d41d8cd9", "cliui@7.0.4@d41d8cd9" @@ -1529,9 +1529,9 @@ "ava@3.15.0@d41d8cd9", "@reason-native/rely@3.2.1@d41d8cd9", "@reason-native/pastel@0.3.0@d41d8cd9", "@reason-native/console@0.1.0@d41d8cd9", + "@opam/dune-configurator@opam:2.8.5@428293ca", "@opam/dune@opam:2.8.5@01003f12", "@opam/cmdliner@opam:1.0.4@93208aac", - "@opam/camlimages@opam:5.0.4@f4b818fa", "@esy-ocaml/reason@3.7.0@d41d8cd9" ], "devDependencies": [ @@ -2645,7 +2645,7 @@ "overrides": [], "dependencies": [ "slash@3.0.0@d41d8cd9", "merge2@1.4.1@d41d8cd9", - "ignore@5.1.8@d41d8cd9", "fast-glob@3.2.5@d41d8cd9", + "ignore@5.1.8@d41d8cd9", "fast-glob@3.2.6@d41d8cd9", "dir-glob@3.0.1@d41d8cd9", "array-union@2.1.0@d41d8cd9" ], "devDependencies": [] @@ -2852,21 +2852,21 @@ "dependencies": [ "reusify@1.0.4@d41d8cd9" ], "devDependencies": [] }, - "fast-glob@3.2.5@d41d8cd9": { - "id": "fast-glob@3.2.5@d41d8cd9", + "fast-glob@3.2.6@d41d8cd9": { + "id": "fast-glob@3.2.6@d41d8cd9", "name": "fast-glob", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz#sha1:7939af2a656de79a4f1901903ee8adcaa7cb9661" + "archive:https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz#sha1:434dd9529845176ea049acc9343e8282765c6e1a" ] }, "overrides": [], "dependencies": [ - "picomatch@2.3.0@d41d8cd9", "micromatch@4.0.4@d41d8cd9", - "merge2@1.4.1@d41d8cd9", "glob-parent@5.1.2@d41d8cd9", - "@nodelib/fs.walk@1.2.7@d41d8cd9", "@nodelib/fs.stat@2.0.5@d41d8cd9" + "micromatch@4.0.4@d41d8cd9", "merge2@1.4.1@d41d8cd9", + "glob-parent@5.1.2@d41d8cd9", "@nodelib/fs.walk@1.2.7@d41d8cd9", + "@nodelib/fs.stat@2.0.5@d41d8cd9" ], "devDependencies": [] }, @@ -3287,14 +3287,14 @@ "dependencies": [], "devDependencies": [] }, - "convert-source-map@1.7.0@d41d8cd9": { - "id": "convert-source-map@1.7.0@d41d8cd9", + "convert-source-map@1.8.0@d41d8cd9": { + "id": "convert-source-map@1.8.0@d41d8cd9", "name": "convert-source-map", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz#sha1:17a2cb882d7f77d3490585e2ce6c524424a3a442" + "archive:https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz#sha1:f3373c32d21b4d780dd8004514684fb791ca4369" ] }, "overrides": [], @@ -3890,7 +3890,7 @@ "figures@3.2.0@d41d8cd9", "equal-length@1.0.1@d41d8cd9", "emittery@0.8.1@d41d8cd9", "del@6.0.0@d41d8cd9", "debug@4.3.2@d41d8cd9", "currently-unhandled@0.4.1@d41d8cd9", - "convert-source-map@1.7.0@d41d8cd9", "concordance@5.0.4@d41d8cd9", + "convert-source-map@1.8.0@d41d8cd9", "concordance@5.0.4@d41d8cd9", "common-path-prefix@3.0.0@d41d8cd9", "code-excerpt@3.0.0@d41d8cd9", "cli-truncate@2.1.0@d41d8cd9", "cli-cursor@3.1.0@d41d8cd9", "clean-yaml-object@0.1.0@d41d8cd9", @@ -3899,7 +3899,7 @@ "chalk@4.1.1@d41d8cd9", "callsites@3.1.0@d41d8cd9", "arrify@2.0.1@d41d8cd9", "arrgv@1.0.2@d41d8cd9", "ansi-styles@5.2.0@d41d8cd9", "acorn-walk@8.1.0@d41d8cd9", - "acorn@8.4.0@d41d8cd9", "@concordance/react@2.0.0@d41d8cd9" + "acorn@8.4.1@d41d8cd9", "@concordance/react@2.0.0@d41d8cd9" ], "devDependencies": [] }, @@ -4131,14 +4131,14 @@ "dependencies": [], "devDependencies": [] }, - "acorn@8.4.0@d41d8cd9": { - "id": "acorn@8.4.0@d41d8cd9", + "acorn@8.4.1@d41d8cd9": { + "id": "acorn@8.4.1@d41d8cd9", "name": "acorn", - "version": "8.4.0", + "version": "8.4.1", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/acorn/-/acorn-8.4.0.tgz#sha1:af53266e698d7cffa416714b503066a82221be60" + "archive:https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz#sha1:56c36251fc7cabc7096adc18f05afe814321a28c" ] }, "overrides": [], @@ -4436,58 +4436,6 @@ "ocaml@4.10.2000@d41d8cd9", "@opam/dune@opam:2.8.5@01003f12" ] }, - "@opam/stdio@opam:v0.14.0@a5affb43": { - "id": "@opam/stdio@opam:v0.14.0@a5affb43", - "name": "@opam/stdio", - "version": "opam:v0.14.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/4c/4cbdf15f0be88c3258aaeff9e04e00e9#md5:4cbdf15f0be88c3258aaeff9e04e00e9", - "archive:https://ocaml.janestreet.com/ocaml-core/v0.14/files/stdio-v0.14.0.tar.gz#md5:4cbdf15f0be88c3258aaeff9e04e00e9" - ], - "opam": { - "name": "stdio", - "version": "v0.14.0", - "path": "esy.lock/opam/stdio.v0.14.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/dune@opam:2.8.5@01003f12", - "@opam/base@opam:v0.14.1@9b424fee", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/dune@opam:2.8.5@01003f12", - "@opam/base@opam:v0.14.1@9b424fee" - ] - }, - "@opam/sexplib0@opam:v0.14.0@155c136c": { - "id": "@opam/sexplib0@opam:v0.14.0@155c136c", - "name": "@opam/sexplib0", - "version": "opam:v0.14.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/37/37aff0af8f8f6f759249475684aebdc4#md5:37aff0af8f8f6f759249475684aebdc4", - "archive:https://ocaml.janestreet.com/ocaml-core/v0.14/files/sexplib0-v0.14.0.tar.gz#md5:37aff0af8f8f6f759249475684aebdc4" - ], - "opam": { - "name": "sexplib0", - "version": "v0.14.0", - "path": "esy.lock/opam/sexplib0.v0.14.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/dune@opam:2.8.5@01003f12", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/dune@opam:2.8.5@01003f12" - ] - }, "@opam/seq@opam:base@d8d7de1d": { "id": "@opam/seq@opam:base@d8d7de1d", "name": "@opam/seq", @@ -5182,36 +5130,6 @@ ], "devDependencies": [ "ocaml@4.10.2000@d41d8cd9" ] }, - "@opam/camlimages@opam:5.0.4@f4b818fa": { - "id": "@opam/camlimages@opam:5.0.4@f4b818fa", - "name": "@opam/camlimages", - "version": "opam:5.0.4", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/1d/1ddba74d210b86a899b5d6565f45c2dc#md5:1ddba74d210b86a899b5d6565f45c2dc", - "archive:https://gitlab.com/camlspotter/camlimages/-/archive/5.0.4/camlimages-5.0.4.tar.bz2#md5:1ddba74d210b86a899b5d6565f45c2dc" - ], - "opam": { - "name": "camlimages", - "version": "5.0.4", - "path": "esy.lock/opam/camlimages.5.0.4" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/stdio@opam:v0.14.0@a5affb43", - "@opam/ocamlfind@opam:1.9.1@b748edf6", - "@opam/dune-configurator@opam:2.8.5@428293ca", - "@opam/dune@opam:2.8.5@01003f12", "@opam/cppo@opam:1.6.7@57a6d52c", - "@opam/base@opam:v0.14.1@9b424fee", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/stdio@opam:v0.14.0@a5affb43", - "@opam/dune@opam:2.8.5@01003f12", "@opam/base@opam:v0.14.1@9b424fee" - ] - }, "@opam/biniou@opam:1.2.1@420bda02": { "id": "@opam/biniou@opam:1.2.1@420bda02", "name": "@opam/biniou", @@ -5272,34 +5190,6 @@ "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [] }, - "@opam/base@opam:v0.14.1@9b424fee": { - "id": "@opam/base@opam:v0.14.1@9b424fee", - "name": "@opam/base", - "version": "opam:v0.14.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e4/e4419eae60f57e553b154856f0cacf42#md5:e4419eae60f57e553b154856f0cacf42", - "archive:https://github.com/janestreet/base/archive/v0.14.1.tar.gz#md5:e4419eae60f57e553b154856f0cacf42" - ], - "opam": { - "name": "base", - "version": "v0.14.1", - "path": "esy.lock/opam/base.v0.14.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/sexplib0@opam:v0.14.0@155c136c", - "@opam/dune-configurator@opam:2.8.5@428293ca", - "@opam/dune@opam:2.8.5@01003f12", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.10.2000@d41d8cd9", "@opam/sexplib0@opam:v0.14.0@155c136c", - "@opam/dune-configurator@opam:2.8.5@428293ca", - "@opam/dune@opam:2.8.5@01003f12" - ] - }, "@opam/atdgen-runtime@opam:2.2.1@c520dbfc": { "id": "@opam/atdgen-runtime@opam:2.2.1@c520dbfc", "name": "@opam/atdgen-runtime", diff --git a/esy.lock/opam/base.v0.14.1/opam b/esy.lock/opam/base.v0.14.1/opam deleted file mode 100644 index eb9603ef..00000000 --- a/esy.lock/opam/base.v0.14.1/opam +++ /dev/null @@ -1,36 +0,0 @@ -opam-version: "2.0" -maintainer: "Jane Street developers" -authors: ["Jane Street Group, LLC"] -homepage: "https://github.com/janestreet/base" -bug-reports: "https://github.com/janestreet/base/issues" -dev-repo: "git+https://github.com/janestreet/base.git" -doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/base/index.html" -license: "MIT" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.08.0"} - "sexplib0" {>= "v0.14" & < "v0.15"} - "dune" {>= "2.0.0"} - "dune-configurator" -] -synopsis: "Full standard library replacement for OCaml" -description: " -Full standard library replacement for OCaml - -Base is a complete and portable alternative to the OCaml standard -library. It provides all standard functionalities one would expect -from a language standard library. It uses consistent conventions -across all of its module. - -Base aims to be usable in any context. As a result system dependent -features such as I/O are not offered by Base. They are instead -provided by companion libraries such as stdio: - - https://github.com/janestreet/stdio -" -url { - src: "https://github.com/janestreet/base/archive/v0.14.1.tar.gz" - checksum: "md5=e4419eae60f57e553b154856f0cacf42" -} diff --git a/esy.lock/opam/camlimages.5.0.4/opam b/esy.lock/opam/camlimages.5.0.4/opam deleted file mode 100644 index 479e329e..00000000 --- a/esy.lock/opam/camlimages.5.0.4/opam +++ /dev/null @@ -1,32 +0,0 @@ -opam-version: "2.0" -maintainer: "jun.furuse@gmail.com" -authors: ["Jun Furuse" "François Pessaux" "Pierre Weis"] -homepage: "https://gitlab.com/camlspotter/camlimages" -bug-reports: - "https://gitlab.com/camlspotter/camlimages/-/issues" -license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" -dev-repo: "git+https://gitlab.com/camlspotter/camlimages" -build: ["dune" "build" "-p" name "-j" jobs] -depends: [ - "base" - "cppo" {build} - "dune" {>= "1.11"} - "dune-configurator" {build & >= "2.0.0"} - "ocaml" {>= "4.07.0"} - "ocamlfind" {build} - "stdio" -] -depopts: ["lablgtk" "graphics"] -conflicts: [ - "lablgtk" {< "2.18.6"} -] -synopsis: "Image processing library" -description: """ -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.""" -url { - src: "https://gitlab.com/camlspotter/camlimages/-/archive/5.0.4/camlimages-5.0.4.tar.bz2" - checksum: "md5=1ddba74d210b86a899b5d6565f45c2dc" -} diff --git a/esy.lock/opam/sexplib0.v0.14.0/opam b/esy.lock/opam/sexplib0.v0.14.0/opam deleted file mode 100644 index a618b826..00000000 --- a/esy.lock/opam/sexplib0.v0.14.0/opam +++ /dev/null @@ -1,26 +0,0 @@ -opam-version: "2.0" -maintainer: "Jane Street developers" -authors: ["Jane Street Group, LLC"] -homepage: "https://github.com/janestreet/sexplib0" -bug-reports: "https://github.com/janestreet/sexplib0/issues" -dev-repo: "git+https://github.com/janestreet/sexplib0.git" -doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/sexplib0/index.html" -license: "MIT" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.04.2"} - "dune" {>= "2.0.0"} -] -synopsis: "Library containing the definition of S-expressions and some base converters" -description: " -Part of Jane Street's Core library -The Core suite of libraries is an industrial strength alternative to -OCaml's standard library that was developed by Jane Street, the -largest industrial user of OCaml. -" -url { - src: "https://ocaml.janestreet.com/ocaml-core/v0.14/files/sexplib0-v0.14.0.tar.gz" - checksum: "md5=37aff0af8f8f6f759249475684aebdc4" -} diff --git a/esy.lock/opam/stdio.v0.14.0/opam b/esy.lock/opam/stdio.v0.14.0/opam deleted file mode 100644 index cbe4a1e6..00000000 --- a/esy.lock/opam/stdio.v0.14.0/opam +++ /dev/null @@ -1,27 +0,0 @@ -opam-version: "2.0" -maintainer: "Jane Street developers" -authors: ["Jane Street Group, LLC"] -homepage: "https://github.com/janestreet/stdio" -bug-reports: "https://github.com/janestreet/stdio/issues" -dev-repo: "git+https://github.com/janestreet/stdio.git" -doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/stdio/index.html" -license: "MIT" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.04.2"} - "base" {>= "v0.14" & < "v0.15"} - "dune" {>= "2.0.0"} -] -synopsis: "Standard IO library for OCaml" -description: " -Stdio implements simple input/output functionalities for OCaml. - -It re-exports the input/output functions of the OCaml standard -libraries using a more consistent API. -" -url { - src: "https://ocaml.janestreet.com/ocaml-core/v0.14/files/stdio-v0.14.0.tar.gz" - checksum: "md5=4cbdf15f0be88c3258aaeff9e04e00e9" -} diff --git a/io/CamlImagesIO.re b/io/CamlImagesIO.re deleted file mode 100644 index b422fca8..00000000 --- a/io/CamlImagesIO.re +++ /dev/null @@ -1,73 +0,0 @@ -open Util; -open Odiff; - -module IO: ImageIO.ImageIO = { - type t = Rgba32.t; - type row = int; - let readRow = (_, y) => y; - - let loadImage = (filename): Odiff.ImageIO.img(t) => { - let camlimage = - switch (Images.load(filename, [])) { - | Index8(i8img) => Index8.to_rgba32(i8img) - | Rgb24(rgba24img) => Rgb24.to_rgba32(rgba24img) - | Rgba32(img) => img - | _ => raise(ImageIO.ImageNotLoaded) - }; - - {width: camlimage.width, height: camlimage.height, image: camlimage}; - }; - - let saveImage = (img: ImageIO.img(t), filename) => { - ReadPng.write_png_buffer( - filename, - Rgba32.dump(img.image), - img.width, - img.height, - ); - }; - - let readDirectPixel = (~x, ~y, img: ImageIO.img(Rgba32.t)) => { - let (bytes, position) = Rgba32.unsafe_access(img.image, x, y); - - let r = Char.code(Bytes.unsafe_get(bytes, position + 0)) land 0xFF; - let g = Char.code(Bytes.unsafe_get(bytes, position + 1)) land 0xFF; - let b = Char.code(Bytes.unsafe_get(bytes, position + 2)) land 0xFF; - let a = Char.code(Bytes.unsafe_get(bytes, position + 3)) land 0xFF; - - Int32.of_int(a lsl 24 + b lsl 16 + g lsl 8 + r); - }; - - let readImgColor = (x, y, img: ImageIO.img(t)) => - readDirectPixel(~x, ~y, img); - - let setImgColor = (x, y, (r, g, b), img: ImageIO.img(t)) => { - let (bytes, position) = Rgba32.unsafe_access(img.image, x, y); - - Bytes.unsafe_set(bytes, position, r |> char_of_int); - Bytes.unsafe_set(bytes, position + 1, g |> char_of_int); - Bytes.unsafe_set(bytes, position + 2, b |> char_of_int); - Bytes.unsafe_set(bytes, position + 3, 255 |> char_of_int); - }; - - let freeImage = _ => (); - - let makeSameAsLayout = (img: ImageIO.img(t)) => { - { - ...img, - image: - Rgba32.make( - img.width, - img.height, - { - color: { - r: 0, - g: 0, - b: 0, - }, - alpha: 0, - }, - ), - }; - }; -}; diff --git a/io/dune b/io/dune index 422c3a5d..fceaa5d5 100644 --- a/io/dune +++ b/io/dune @@ -12,7 +12,7 @@ (:include c_flags.sexp))) (c_library_flags (:include c_library_flags.sexp)) - (libraries odiff-core camlimages.jpeg camlimages.tiff camlimages.xpm)) + (libraries odiff-core)) (rule (targets flags.sexp c_flags.sexp c_library_flags.sexp) diff --git a/package.json b/package.json index 03d33e5c..4f89f48d 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,17 @@ { "name": "odiff", - "version": "2.4.0", + "version": "2.4.1", "description": "The fastest image difference tool.", "license": "MIT", "esy": { "build": "dune build --release --only-packages odiff,odiff-io,odiff-core", - "buildDev": "refmterr dune build --promote-install-files --root . --only-packages odiff,odiff-io,odiff-core", + "buildDev": + "refmterr dune build --promote-install-files --root . --only-packages odiff,odiff-io,odiff-core", "release": { - "bin": { - "odiff": "ODiffBin" - }, - "includePackages": [ - "odiff" - ] + "bin": { "odiff": "ODiffBin" }, + "includePackages": [ "odiff" ] }, - "buildEnv": { - "ODOC_SYNTAX": "re" - } + "buildEnv": { "ODOC_SYNTAX": "re" } }, "scripts": { "run": "esy x ODiffBin", @@ -28,14 +23,15 @@ }, "dependencies": { "@esy-ocaml/reason": ">= 3.6.0 < 4.0.0", - "@opam/camlimages": "5.0.4", "@opam/cmdliner": "1.0.4", "@opam/dune": "< 3.0.0", + "@opam/dune-configurator": "2.8.5", "@reason-native/console": "*", "@reason-native/pastel": "*", "@reason-native/rely": "^3.2.1", "ava": "^3.15.0", - "esy-libpng": "eWert-Online/esy-libpng#485fec4990dbb0f6b0ecb3ced53f5bd7bc9a4506", + "esy-libpng": + "eWert-Online/esy-libpng#485fec4990dbb0f6b0ecb3ced53f5bd7bc9a4506", "esy-zlib": "*", "ocaml": "~4.10.0" }, @@ -46,7 +42,8 @@ "refmterr": "*" }, "resolutions": { - "esy-zlib": "eWert-Online/esy-zlib#9b0394f07551d9fde386e28a6ff269984b63ffcf" + "esy-zlib": + "eWert-Online/esy-zlib#9b0394f07551d9fde386e28a6ff269984b63ffcf" }, "repository": { "type": "git", @@ -57,4 +54,4 @@ "name": "Dmitriy Kovalenko", "url": "https://dmtrkovalenko.dev" } -} +} \ No newline at end of file