gnu: r-fields: Update to 11.4.
[jackhill/guix/guix.git] / gnu / packages / image.scm
index 393ee7e..4606cc7 100644 (file)
@@ -11,7 +11,7 @@
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2017 Nikita <nikita@n0.is>
 ;;; Copyright © 2017,2019,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (guix build-system scons)
   #:use-module (guix deprecation)
   #:use-module (srfi srfi-1))
 
+(define-public iqa
+  (package
+    (name "iqa")
+    (version "1.1.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://sourceforge.net/projects/iqa/files/"
+                       "1.1.2%20Release/iqa_1.1.2_src.tar.gz/download"))
+       (sha256
+        (base32 "00mgwy031ammab6bwmd1whhvqv3fxy1cs1igabq0n3ag12zhjs77"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib")))
+               (install-file "build/debug/libiqa.a" lib)
+               #t))))))
+    (synopsis "Image Quality Assessment")
+    (description "IQA is a C library for objectively measuring image/video
+quality.  It implements many popular algorithms, such as MS-SSIM, MS-SSIM*,
+SIMM, MSE, and PSNR.  It is designed to be fast, accurate, and reliable.  All
+code is Valgrind-clean and unit tested.")
+    (home-page "https://sourceforge.net/projects/iqa/")
+    (license license:bsd-4)))
+
 (define-public libpng
   (package
    (name "libpng")
@@ -308,7 +341,7 @@ Currently all documentation resides in @file{pnglite.h}.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ImageOptim/libimagequant.git")
+             (url "https://github.com/ImageOptim/libimagequant")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -332,7 +365,7 @@ and other PNG optimizers.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/kornelski/pngquant.git")
+             (url "https://github.com/kornelski/pngquant")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -371,13 +404,13 @@ Features:
 (define-public ijg-libjpeg
   (package
    (name "libjpeg")
-   (version "9c")
+   (version "9d")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
                    version ".tar.gz"))
             (sha256 (base32
-                     "08kixcf3a7s9x91174abjnk1xbvj4v8crdc73zi4k9h3jfbm00k5"))))
+                     "0clwys9lcqlxqgcw8s1gwfm5ix2zjlqpklmd3mbvqmj5ibj51jwr"))))
    (build-system gnu-build-system)
    (synopsis "Library for handling JPEG files")
    (description
@@ -397,16 +430,6 @@ lossless JPEG manipulations such as rotation, scaling or cropping:
    (license license:ijg)
    (home-page "https://www.ijg.org/")))
 
-(define-public ijg-libjpeg-8
-  (package (inherit ijg-libjpeg)
-   (version "8d")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
-                   version ".tar.gz"))
-            (sha256 (base32
-                     "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
-
 (define-public libjxr
   (package
     (name "libjxr")
@@ -553,7 +576,7 @@ extracting icontainer icon files.")
    (source
      (origin
        (method url-fetch)
-       (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
+       (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
                            version ".tar.gz"))
        (sha256
         (base32
@@ -588,7 +611,7 @@ collection of tools for doing simple manipulations of TIFF images.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/DanBloomberg/leptonica.git")
+             (url "https://github.com/DanBloomberg/leptonica")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -758,6 +781,28 @@ images of initially unknown height.")
     (license (list license:isc          ; pbmtools/p?m.5
                    license:gpl2+))))    ; the rest
 
+(define-public openjpeg-data
+  (package
+    (name "openjpeg-data")
+    (version "2020.05.19")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/uclouvain/openjpeg-data.git")
+         (commit "c5c4a8c")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1jp84gbhw8q5b8mhc322ql9410hjf32w9hg10x4isfa9j59mnncb"))))
+    (build-system copy-build-system)
+    (synopsis "Test files for OpenJPEG")
+    (description "OpenJPEG-Data contains all files required to run the openjpeg
+test suite, including conformance tests (following Rec. ITU-T T.803 | ISO/IEC
+15444-4 procedures), non-regression tests and unit tests.")
+    (home-page "https://github.com/uclouvain/openjpeg-data")
+    (license license:bsd-2)))
+
 (define-public openjpeg
   (package
     (name "openjpeg")
@@ -995,7 +1040,7 @@ more modular, simple, and flexible.")
     (home-page
      ;; This vanished page is universally accepted as giblib's home despite not
      ;; mentioning the package once.
-     (string-append "https://web.archive.org/web/20140907071208"
+     (string-append "https://web.archive.org/web/20140907071208/"
                     "https://linuxbrit.co.uk/software/"))
     (synopsis "Wrapper library for imlib2")
     (description
@@ -1029,7 +1074,19 @@ supplies a generic doubly-linked list and some string functions.")
                     (delete-file-recursively (string-append "Source/" dir)))
                   '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
                     "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
-            (patches (search-patches "freeimage-unbundle.patch"))))
+            (patches
+             (append
+              (search-patches "freeimage-unbundle.patch")
+              ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
+              (list (origin
+                      (method url-fetch)
+                      (uri "https://raw.githubusercontent.com/archlinux\
+/svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
+/freeimage-libraw-0.20.patch")
+                      (file-name "freeimage-libraw-compat.patch")
+                      (sha256
+                       (base32
+                        "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
    (build-system gnu-build-system)
    (arguments
     '(#:phases
@@ -1258,14 +1315,14 @@ channels.")
 (define-public exiv2
   (package
     (name "exiv2")
-    (version "0.27.2")
+    (version "0.27.3")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
                            "-Source.tar.gz"))
        (sha256
-        (base32 "0gqminvj14xm3rgbnydbywf22608js80rp7nmxxk4497j5mzali6"))))
+        (base32 "0y77wfadjsrcxijdqgkr3q88b6mm9y3rg8kqsmaig8iah49md7x7"))))
     (build-system cmake-build-system)
     (arguments '(#:tests? #f))          ; no test suite
     (propagated-inputs
@@ -1352,17 +1409,29 @@ convert, manipulate, filter and display a wide variety of image formats.")
 (define-public jasper
   (package
     (name "jasper")
-    (version "2.0.16")
+    (version "2.0.20")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/mdadams/jasper.git")
+                    (url "https://github.com/mdadams/jasper")
                     (commit (string-append "version-" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "05l75yd1zsxwv25ykwwwjs8961szv7iywf16nc6vc6qpby27ckv6"))))
+                "1bn4mg6l5afryrlyk3y7p3accdq113fis8hpwywy5g51ycablz3h"))))
     (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-checking-disabled-things
+           (lambda _
+             ;; The MIF codec was disabled for security reasons in JasPer 2.0.20
+             ;; but its test suite still assumes that the format is supported.
+             (for-each delete-file
+                       (find-files "data/test" "\\.mif$")) ; for run_test_1
+             (substitute* "test/bin/run_test_2"
+               (("image_formats\\+=\\(mif\\)") ""))
+             #t)))))
     (inputs `(("libjpeg" ,libjpeg-turbo)))
     (synopsis "JPEG-2000 library")
     (description "The JasPer Project is an initiative to provide a reference
@@ -1379,7 +1448,7 @@ ISO/IEC 15444-1).")
       (origin
         (method git-fetch)
         (uri (git-reference
-              (url "https://github.com/sekrit-twc/zimg.git")
+              (url "https://github.com/sekrit-twc/zimg")
               (commit (string-append "release-" version))))
         (file-name (git-file-name name version))
         (sha256
@@ -1407,7 +1476,7 @@ the programmer.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/myint/perceptualdiff.git")
+             (url "https://github.com/myint/perceptualdiff")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -1481,7 +1550,7 @@ changed, making the embedding resistant against first-order statistical tests.")
       (source
        (origin (method git-fetch)
                (uri (git-reference
-                     (url "https://github.com/extemporelang/stb.git")
+                     (url "https://github.com/extemporelang/stb")
                      (commit commit)))
                (sha256
                 (base32
@@ -1577,6 +1646,7 @@ is hereby granted."))))
   (package
     (name "libjpeg-turbo")
     (version "2.0.4")
+    (replacement libjpeg-turbo/fixed)
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
@@ -1633,6 +1703,18 @@ and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
                    license:ijg          ;the libjpeg library and associated tools
                    license:zlib))))     ;the libjpeg-turbo SIMD extensions
 
+(define libjpeg-turbo/fixed
+  (package
+    (inherit libjpeg-turbo)
+    (version "2.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
+                                  version "/libjpeg-turbo-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0pbv6pc97kbj7ib31qcwi7lnmm9xg5y3b11aasmkhfjvf7rgdy0n"))))))
+
 (define-deprecated libjpeg libjpeg-turbo)
 (export libjpeg)
 
@@ -1687,7 +1769,7 @@ medical image data, e.g. magnetic resonance image (MRI) and functional MRI
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/thezbyg/gpick.git")
+                    (url "https://github.com/thezbyg/gpick")
                     (commit (string-append name "-" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -1750,7 +1832,7 @@ parsing, viewing, modifying, and saving this metadata.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/lupoDharkael/flameshot.git")
+             (url "https://github.com/lupoDharkael/flameshot")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -1858,16 +1940,16 @@ identical visual appearance.")
 (define-public grim
   (package
    (name "grim")
-   (version "1.2.0")
+   (version "1.3.1")
    (source
     (origin
      (method git-fetch)
      (uri (git-reference
-           (url "https://github.com/emersion/grim.git")
+           (url "https://github.com/emersion/grim")
            (commit (string-append "v" version))))
      (file-name (git-file-name name version))
      (sha256
-      (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
+      (base32 "0fjmjq0ws9rlblkcqxxw2lv7zvvyi618jqzlnz5z9zb477jwdfib"))))
    (build-system meson-build-system)
    (native-inputs `(("pkg-config" ,pkg-config)
                     ("scdoc" ,scdoc)))
@@ -1889,7 +1971,7 @@ identical visual appearance.")
     (origin
      (method git-fetch)
      (uri (git-reference
-           (url "https://github.com/emersion/slurp.git")
+           (url "https://github.com/emersion/slurp")
            (commit (string-append "v" version))))
      (file-name (git-file-name name version))
      (sha256
@@ -2120,3 +2202,55 @@ It can create and edit indexed palette or 24bit RGB images, offers basic
 painting and palette manipulation tools.  It also handles JPEG, JPEG2000,
 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
     (license license:gpl3+)))
+
+(define-public phockup
+  (package
+    (name "phockup")
+    (version "1.5.9")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ivandokov/phockup")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "13ajj0xch7yfqaaxbw0awxs0fz17n1rxir4gqh2wcgxjysqk1j2y"))))
+    (build-system copy-build-system)
+    (arguments
+     `(#:install-plan '(("src" "share/phockup/")
+                        ("phockup.py" "share/phockup/"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'configure
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* (list "src/dependency.py" "src/exif.py")
+               (("exiftool")
+                (string-append (assoc-ref inputs "perl-image-exiftool")
+                               "/bin/exiftool")))
+             #t))
+         (add-before 'install 'check
+           (lambda _
+             (invoke "pytest")))
+         (add-after 'install 'install-bin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (mkdir (string-append out "/bin"))
+               (symlink (string-append out "/share/phockup/phockup.py")
+                        (string-append out "/bin/phockup")))
+             #t)))))
+    (inputs
+     `(("perl-image-exiftool" ,perl-image-exiftool)
+       ("python" ,python)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-mock" ,python-pytest-mock)))
+    (home-page "https://github.com/ivandokov/phockup")
+    (synopsis "Organize photos and videos in folders")
+    (description "Phockup is a media sorting tool that uses creation date and
+time information in photos and videos to organize them into folders by year,
+month and day.  All files which are not images or videos or those which do not
+have creation date information will be placed in a folder called
+@file{unknown}.")
+    (license license:expat)))