92447c23e2ca96a62efe667f68645db69c7a0ce2
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2014, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
9 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2016, 2017, 2018 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
17 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
18 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
19 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
20 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
21 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
22 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
23 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
24 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
25 ;;;
26 ;;; This file is part of GNU Guix.
27 ;;;
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
32 ;;;
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
37 ;;;
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41 (define-module (gnu packages image)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages assembly)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages fontutils)
52 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
53 #:use-module (gnu packages gcc)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages ghostscript)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages graphics)
59 #:use-module (gnu packages gtk)
60 #:use-module (gnu packages lua)
61 #:use-module (gnu packages maths)
62 #:use-module (gnu packages mcrypt)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages photo)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages xml)
68 #:use-module (gnu packages xorg)
69 #:use-module (gnu packages qt)
70 #:use-module ((guix licenses) #:prefix license:)
71 #:use-module (guix packages)
72 #:use-module (guix download)
73 #:use-module (guix git-download)
74 #:use-module (guix build-system gnu)
75 #:use-module (guix build-system cmake)
76 #:use-module (guix build-system python)
77 #:use-module (guix build-system r)
78 #:use-module (guix build-system scons)
79 #:use-module (srfi srfi-1))
80
81 (define-public libpng
82 (package
83 (name "libpng")
84 (version "1.6.34")
85 (source (origin
86 (method url-fetch)
87 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
88 version "/libpng-" version ".tar.xz")
89 (string-append
90 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
91 "/libpng16/libpng-" version ".tar.xz")
92 (string-append
93 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
94 "/libpng16/libpng-" version ".tar.xz")))
95 (sha256
96 (base32
97 "1xjr0v34fyjgnhvaa1zixcpx5yvxcg4zwvfh0fyklfyfj86rc7ig"))))
98 (build-system gnu-build-system)
99
100 ;; libpng.la says "-lz", so propagate it.
101 (propagated-inputs `(("zlib" ,zlib)))
102
103 (synopsis "Library for handling PNG files")
104 (description
105 "Libpng is the official PNG (Portable Network Graphics) reference
106 library. It supports almost all PNG features and is extensible.")
107 (license license:zlib)
108 (home-page "http://www.libpng.org/pub/png/libpng.html")))
109
110 ;; libpng-apng should be updated when the APNG patch is released:
111 ;; <https://bugs.gnu.org/27556>
112 (define-public libpng-apng
113 (package
114 (name "libpng-apng")
115 (version "1.6.28")
116 (source
117 (origin
118 (method url-fetch)
119 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
120 version "/libpng-" version ".tar.xz")
121 (string-append
122 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
123 "/libpng16/libpng-" version ".tar.xz")
124 (string-append
125 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
126 "/libpng16/libpng-" version ".tar.xz")))
127 (sha256
128 (base32
129 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
130 (build-system gnu-build-system)
131 (arguments
132 `(#:modules ((guix build gnu-build-system)
133 (guix build utils)
134 (srfi srfi-1))
135 #:phases
136 (modify-phases %standard-phases
137 (add-after 'unpack 'patch-apng
138 (lambda* (#:key inputs #:allow-other-keys)
139 (define (apply-patch file)
140 (invoke "patch" "-p1" "--force"
141 "--input" file))
142 (let ((apng.gz (assoc-ref inputs "apng")))
143 (format #t "Applying APNG patch '~a'...~%"
144 apng.gz)
145 (invoke "sh" "-c"
146 (string-append "gunzip < " apng.gz " > the-patch"))
147 (apply-patch "the-patch")
148 #t)))
149 (add-before 'configure 'no-checks
150 (lambda _
151 (substitute* "Makefile.in"
152 (("^scripts/symbols.chk") "")
153 (("check: scripts/symbols.chk") ""))
154 #t)))))
155 (inputs
156 `(("apng" ,(origin
157 (method url-fetch)
158 (uri
159 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
160 version "/libpng-" version "-apng.patch.gz"))
161 (sha256
162 (base32
163 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
164 (native-inputs
165 `(("libtool" ,libtool)))
166 ;; libpng.la says "-lz", so propagate it.
167 (propagated-inputs
168 `(("zlib" ,zlib)))
169 (synopsis "APNG patch for libpng")
170 (description
171 "APNG (Animated Portable Network Graphics) is an unofficial
172 extension of the APNG (Portable Network Graphics) format.
173 APNG patch provides APNG support to libpng.")
174 (home-page "https://sourceforge.net/projects/libpng-apng/")
175 (license license:zlib)))
176
177 (define-public libpng-1.2
178 (package
179 (inherit libpng)
180 (version "1.2.59")
181 (source
182 (origin
183 (method url-fetch)
184 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
185 version "/libpng-" version ".tar.xz")
186 (string-append
187 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
188 "/libpng12/libpng-" version ".tar.xz")
189 (string-append
190 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
191 "/libpng12/libpng-" version ".tar.xz")))
192 (sha256
193 (base32
194 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
195
196 (define-public r-png
197 (package
198 (name "r-png")
199 (version "0.1-7")
200 (source (origin
201 (method url-fetch)
202 (uri (cran-uri "png" version))
203 (sha256
204 (base32
205 "0g2mcp55lvvpx4kd3mn225mpbxqcq73wy5qx8b4lyf04iybgysg2"))))
206 (build-system r-build-system)
207 (inputs
208 `(("libpng" ,libpng)
209 ("zlib" ,zlib)))
210 (home-page "http://www.rforge.net/png/")
211 (synopsis "Read and write PNG images")
212 (description
213 "This package provides an easy and simple way to read, write and display
214 bitmap images stored in the PNG format. It can read and write both files and
215 in-memory raw vectors.")
216 ;; Any of these GPL versions.
217 (license (list license:gpl2 license:gpl3))))
218
219 (define-public pngcrush
220 (package
221 (name "pngcrush")
222 (version "1.8.13")
223 (source (origin
224 (method url-fetch)
225 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
226 version "/pngcrush-" version "-nolib.tar.xz"))
227 (sha256 (base32
228 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
229 (build-system gnu-build-system)
230 (arguments
231 '(#:tests? #f ; no check target
232 #:phases
233 (modify-phases %standard-phases
234 (replace 'configure
235 (lambda* (#:key inputs outputs #:allow-other-keys)
236 (substitute* "Makefile"
237 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
238 (string-append vardef (assoc-ref inputs "libpng") "/"))
239 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
240 (string-append vardef (assoc-ref inputs "zlib") "/"))
241 ;; The Makefile is written by hand and not using $PREFIX
242 (("\\$\\(DESTDIR\\)/usr/")
243 (string-append (assoc-ref outputs "out") "/")))
244 #t)))))
245 (inputs
246 `(("libpng" ,libpng)
247 ("zlib" , zlib)))
248 (home-page "https://pmt.sourceforge.io/pngcrush")
249 (synopsis "Utility to compress PNG files")
250 (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
251 files. It can compress them as much as 40% losslessly.")
252 (license license:zlib)))
253
254 (define-public pngcrunch
255 ;; This package used to be wrongfully name "pngcrunch".
256 (deprecated-package "pngcrunch" pngcrush))
257
258 (define-public pnglite
259 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
260 (revision "1"))
261 (package
262 (name "pnglite")
263 ;; The project was moved from sourceforge to github.
264 ;; The latest version in sourceforge was 0.1.17:
265 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
266 ;; No releases are made in github.
267 (version (git-version "0.1.17" revision commit))
268 (source (origin
269 (method git-fetch)
270 (uri (git-reference
271 (url "https://github.com/dankar/pnglite")
272 (commit commit)))
273 (sha256
274 (base32
275 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
276 (file-name (git-file-name name version))))
277 (build-system gnu-build-system)
278 (arguments
279 `(#:tests? #f ; no tests
280 #:phases
281 (modify-phases %standard-phases
282 (delete 'configure)
283 (replace 'build
284 (lambda _
285 ;; common build flags for building shared libraries
286 (let ((cflags '("-O2" "-g" "-fPIC"))
287 (ldflags '("-shared")))
288 (apply invoke
289 `("gcc"
290 "-o" "libpnglite.so"
291 ,@cflags
292 ,@ldflags
293 "pnglite.c"))
294 #t)))
295 (replace 'install
296 (lambda* (#:key outputs #:allow-other-keys)
297 (let* ((out (assoc-ref outputs "out"))
298 (lib (string-append out "/lib/"))
299 (include (string-append out "/include/"))
300 (doc (string-append out "/share/doc/"
301 ,name "-" ,version "/")))
302 (install-file "libpnglite.so" lib)
303 (install-file "pnglite.h" include)
304 (install-file "README.md" doc)
305 #t))))))
306 (inputs `(("zlib" ,zlib)))
307 (home-page "https://github.com/dankar/pnglite")
308 (synopsis "Pretty small png library")
309 (description "A pretty small png library.
310 Currently all documentation resides in @file{pnglite.h}.")
311 (license license:zlib))))
312
313 (define-public libjpeg
314 (package
315 (name "libjpeg")
316 (version "9c")
317 (source (origin
318 (method url-fetch)
319 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
320 version ".tar.gz"))
321 (sha256 (base32
322 "08kixcf3a7s9x91174abjnk1xbvj4v8crdc73zi4k9h3jfbm00k5"))))
323 (build-system gnu-build-system)
324 (synopsis "Library for handling JPEG files")
325 (description
326 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
327 JPEG is a standardized compression method for full-color and gray-scale
328 images.
329 It also includes programs that provide conversion between the JPEG format and
330 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
331 lossless JPEG manipulations such as rotation, scaling or cropping:
332 @enumerate
333 @item cjpeg
334 @item djpeg
335 @item jpegtran
336 @item rdjpgcom
337 @item wrjpgcom
338 @end enumerate")
339 (license license:ijg)
340 (home-page "http://www.ijg.org/")))
341
342 (define-public libjpeg-8
343 (package (inherit libjpeg)
344 (version "8d")
345 (source (origin
346 (method url-fetch)
347 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
348 version ".tar.gz"))
349 (sha256 (base32
350 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
351
352 (define-public libjxr
353 (package
354 (name "libjxr")
355 (version "1.1")
356 (source (origin
357 ;; We are using the Debian source because CodePlex does not
358 ;; deliver an easily downloadable tarball.
359 (method url-fetch)
360 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
361 version ".orig.tar.gz"))
362 (sha256
363 (base32
364 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
365 (patch-flags '("-p1" "--binary"))
366 (patches (search-patches "libjxr-fix-function-signature.patch"
367 "libjxr-fix-typos.patch"))))
368 (build-system gnu-build-system)
369 (arguments '(#:make-flags '("CC=gcc")
370 #:tests? #f ; no check target
371 #:phases
372 (modify-phases %standard-phases
373 (delete 'configure) ; no configure script
374 ;; The upstream makefile does not include an install phase.
375 (replace 'install
376 (lambda* (#:key outputs #:allow-other-keys)
377 (let* ((out (assoc-ref outputs "out"))
378 (bin (string-append out "/bin"))
379 (lib (string-append out "/lib"))
380 (include (string-append out "/include/jxrlib")))
381 (for-each (lambda (file)
382 (install-file file include)
383 (delete-file file))
384 (append
385 '("jxrgluelib/JXRGlue.h"
386 "jxrgluelib/JXRMeta.h"
387 "jxrtestlib/JXRTest.h"
388 "image/sys/windowsmediaphoto.h")
389 (find-files "common/include" "\\.h$")))
390 (for-each (lambda (file)
391 (install-file file lib)
392 (delete-file file))
393 (find-files "." "\\.a$"))
394 (for-each (lambda (file)
395 (install-file file bin)
396 (delete-file file))
397 '("JxrDecApp" "JxrEncApp")))
398 #t)))))
399 (synopsis "Implementation of the JPEG XR standard")
400 (description "JPEG XR is an approved ISO/IEC International standard (its
401 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
402 (license
403 (license:non-copyleft
404 "file://Makefile"
405 "See the header of the Makefile in the distribution."))
406 (home-page "https://jxrlib.codeplex.com/")))
407
408 (define-public jpegoptim
409 (package
410 (name "jpegoptim")
411 (version "1.4.6")
412 (source (origin
413 (method url-fetch)
414 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
415 version ".tar.gz"))
416 (sha256 (base32
417 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
418 (build-system gnu-build-system)
419 (inputs `(("libjpeg" ,libjpeg)))
420 (arguments
421 '(#:tests? #f)) ; no tests
422 (synopsis "Optimize JPEG images")
423 (description
424 "jpegoptim provides lossless optimization (based on optimizing
425 the Huffman tables) and \"lossy\" optimization based on setting
426 maximum quality factor.")
427 (license license:gpl2+)
428 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
429
430 (define-public libicns
431 (package
432 (name "libicns")
433 (version "0.8.1")
434 (source (origin
435 (method url-fetch)
436 (uri (string-append
437 "mirror://sourceforge/icns/"
438 "libicns-" version ".tar.gz"))
439 (sha256
440 (base32
441 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
442 (build-system gnu-build-system)
443 (inputs
444 `(("libpng" ,libpng)
445 ("jasper" ,jasper)))
446 (arguments
447 `(#:tests? #t)) ; No tests.
448 (home-page "http://icns.sourceforge.net/")
449 (synopsis "Library for handling Mac OS icns resource files")
450 (description
451 "Libicns is a library for the manipulation of Mac OS IconFamily resource
452 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
453 convert between PNG and ICNS. @command{icns2png} will extract image files from
454 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
455 with .desktop files. Additionally, @command{icontainer2png} is provided for
456 extracting icontainer icon files.")
457 (license (list license:lgpl2.1+ ; libicns
458 license:lgpl2.0+ ; src/apidocs.*
459 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
460
461 (define-public libtiff
462 (package
463 (name "libtiff")
464 (version "4.0.9")
465 (source
466 (origin
467 (method url-fetch)
468 (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
469 version ".tar.gz"))
470 (sha256
471 (base32
472 "1kfg4q01r4mqn7dj63ifhi6pmqzbf4xax6ni6kkk81ri5kndwyvf"))
473 (patches (search-patches "libtiff-CVE-2017-9935.patch"
474 "libtiff-CVE-2017-18013.patch"
475 "libtiff-CVE-2018-8905.patch"
476 "libtiff-CVE-2018-10963.patch"))))
477 (build-system gnu-build-system)
478 (outputs '("out"
479 "doc")) ;1.3 MiB of HTML documentation
480 (arguments
481 ;; Instead of using --docdir, this package has its own --with-docdir.
482 `(#:configure-flags (list (string-append "--with-docdir="
483 (assoc-ref %outputs "doc")
484 "/share/doc/"
485 ,name "-" ,version))))
486 (inputs `(("zlib" ,zlib)
487 ("libjpeg" ,libjpeg)))
488 (synopsis "Library for handling TIFF files")
489 (description
490 "Libtiff provides support for the Tag Image File Format (TIFF), a format
491 used for storing image data.
492 Included are a library, libtiff, for reading and writing TIFF and a small
493 collection of tools for doing simple manipulations of TIFF images.")
494 (license (license:non-copyleft "file://COPYRIGHT"
495 "See COPYRIGHT in the distribution."))
496 (home-page "http://www.simplesystems.org/libtiff/")))
497
498 (define-public leptonica
499 (package
500 (name "leptonica")
501 (version "1.74.4")
502 (source
503 (origin
504 (method git-fetch)
505 (uri (git-reference
506 (url "https://github.com/DanBloomberg/leptonica.git")
507 (commit version)))
508 (file-name (git-file-name name version))
509 (sha256
510 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
511 (build-system gnu-build-system)
512 (native-inputs
513 `(("gnuplot" ,gnuplot) ;needed for test suite
514 ("autoconf" ,autoconf)
515 ("automake" ,automake)
516 ("libtool" ,libtool)
517 ("pkg-config" ,pkg-config)))
518 (inputs
519 `(("giflib" ,giflib)
520 ("libjpeg" ,libjpeg)
521 ("libpng" ,libpng)
522 ("libtiff" ,libtiff)
523 ("libwebp" ,libwebp)))
524 (propagated-inputs
525 ;; Linking a program with leptonica also requires these.
526 `(("openjpeg" ,openjpeg)
527 ("zlib" ,zlib)))
528 (arguments
529 '(#:phases
530 (modify-phases %standard-phases
531 (add-after 'unpack 'autogen
532 (lambda _
533 (invoke "sh" "autobuild")))
534 (add-after 'unpack 'patch-reg-wrapper
535 (lambda _
536 (substitute* "prog/reg_wrapper.sh"
537 ((" /bin/sh ")
538 (string-append " " (which "sh") " "))
539 (("which gnuplot")
540 "true"))
541 #t)))))
542 (home-page "http://www.leptonica.com/")
543 (synopsis "Library and tools for image processing and analysis")
544 (description
545 "Leptonica is a C library and set of command-line tools for efficient
546 image processing and image analysis operations. It supports rasterop, affine
547 transformations, binary and grayscale morphology, rank order, and convolution,
548 seedfill and connected components, image transformations combining changes in
549 scale and pixel depth, and pixelwise masking, blending, enhancement, and
550 arithmetic ops.")
551 (license license:bsd-2)))
552
553 (define-public jbig2dec
554 (package
555 (name "jbig2dec")
556 (version "0.15")
557 (source (origin
558 (method url-fetch)
559 (uri (string-append "https://github.com/ArtifexSoftware"
560 "/ghostpdl-downloads/releases/download"
561 "/gs924/" name "-" version ".tar.gz"))
562 (sha256
563 (base32
564 "0m1qwpbjbirgw2fqznbajdhdhh35d6xa2csr64lpjz735pvimykb"))
565 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
566 (build-system gnu-build-system)
567 (arguments '(#:configure-flags '("--disable-static")))
568 (synopsis "Decoder of the JBIG2 image compression format")
569 (description
570 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
571 monochrome) images at moderately high resolution, and in particular scanned
572 paper documents. In this domain it is very efficient, offering compression
573 ratios on the order of 100:1.
574
575 This is a decoder only implementation, and currently is in the alpha
576 stage, meaning it doesn't completely work yet. However, it is
577 maintaining parity with available encoders, so it is useful for real
578 work.")
579 (home-page "https://jbig2dec.com")
580 (license license:gpl2+)))
581
582 (define-public openjpeg
583 (package
584 (name "openjpeg")
585 (version "2.3.0")
586 (source
587 (origin
588 (method url-fetch)
589 (uri
590 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
591 version ".tar.gz"))
592 (file-name (string-append name "-" version ".tar.gz"))
593 (sha256
594 (base32
595 "06npqzkg20avnygdwaqpap91r7qpdqgrn39adj2bl8v0pg0qgirx"))))
596 (build-system cmake-build-system)
597 (arguments
598 ;; Trying to run `$ make check' results in a no rule fault.
599 '(#:tests? #f))
600 (inputs
601 `(("lcms" ,lcms)
602 ("libpng" ,libpng)
603 ("libtiff" ,libtiff)
604 ("zlib" ,zlib)))
605 (synopsis "JPEG 2000 codec")
606 (description
607 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
608 been developed in order to promote the use of JPEG 2000, the new
609 still-image compression standard from the Joint Photographic Experts
610 Group (JPEG).
611
612 In addition to the basic codec, various other features are under
613 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
614 an indexing tool useful for the JPIP protocol, JPWL-tools for
615 error-resilience, a Java-viewer for j2k-images, ...")
616 (home-page "https://github.com/uclouvain/openjpeg")
617 (license license:bsd-2)))
618
619 (define-public openjpeg-1
620 (package (inherit openjpeg)
621 (name "openjpeg")
622 (version "1.5.2")
623 (source
624 (origin
625 (method url-fetch)
626 (uri
627 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
628 name "-" version ".tar.gz"))
629 (sha256
630 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
631
632 (define-public giflib
633 (package
634 (name "giflib")
635 (version "5.1.4")
636 (source (origin
637 (method url-fetch)
638 (uri (string-append "mirror://sourceforge/giflib/giflib-"
639 version ".tar.bz2"))
640 (sha256
641 (base32
642 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
643 (patches (search-patches
644 "giflib-make-reallocarray-private.patch"))))
645 (build-system gnu-build-system)
646 (outputs '("bin" ; utility programs
647 "out")) ; library
648 (inputs `(("libx11" ,libx11)
649 ("libice" ,libice)
650 ("libsm" ,libsm)
651 ("perl" ,perl)))
652 (arguments
653 `(#:phases
654 (modify-phases %standard-phases
655 (add-after 'unpack 'disable-html-doc-gen
656 (lambda _
657 (substitute* "doc/Makefile.in"
658 (("^all: allhtml manpages") ""))
659 #t))
660 (add-after 'install 'install-manpages
661 (lambda* (#:key outputs #:allow-other-keys)
662 (let* ((bin (assoc-ref outputs "bin"))
663 (man1dir (string-append bin "/share/man/man1")))
664 (mkdir-p man1dir)
665 (for-each (lambda (file)
666 (let ((base (basename file)))
667 (format #t "installing `~a' to `~a'~%"
668 base man1dir)
669 (copy-file file
670 (string-append
671 man1dir "/" base))))
672 (find-files "doc" "\\.1"))
673 #t))))))
674 (synopsis "Tools and library for working with GIF images")
675 (description
676 "GIFLIB is a library for reading and writing GIF images. It is API and
677 ABI compatible with libungif which was in wide use while the LZW compression
678 algorithm was patented. Tools are also included to convert, manipulate,
679 compose, and analyze GIF images.")
680 (home-page "http://giflib.sourceforge.net/")
681 (license license:x11)))
682
683 (define-public libungif
684 (package
685 (name "libungif")
686 (version "4.1.4")
687 (source (origin
688 (method url-fetch)
689 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
690 "libungif-" version "/libungif-"
691 version ".tar.bz2"))
692 (sha256
693 (base32
694 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
695 (build-system gnu-build-system)
696 (inputs `(("perl" ,perl))) ;package ships some perl tools
697 (home-page "http://giflib.sourceforge.net/")
698 (synopsis "GIF decompression library")
699 (description
700 "libungif is the old GIF decompression library by the GIFLIB project.")
701 (license license:expat)))
702
703 (define-public imlib2
704 (package
705 (name "imlib2")
706 (version "1.5.1")
707 (source (origin
708 (method url-fetch)
709 (uri (string-append
710 "mirror://sourceforge/enlightenment/imlib2-src/" version
711 "/imlib2-" version ".tar.bz2"))
712 (sha256
713 (base32
714 "1bms2iwmvnvpz5jqq3r52glarqkafif47zbh1ykz8hw85d2mfkps"))))
715 (build-system gnu-build-system)
716 (native-inputs
717 `(("pkgconfig" ,pkg-config)))
718 (inputs
719 `(("libx11" ,libx11)
720 ("libxext" ,libxext)
721 ("freetype" ,freetype)
722 ("libjpeg" ,libjpeg)
723 ("libpng" ,libpng)
724 ("libtiff" ,libtiff)
725 ("giflib" ,giflib)
726 ("bzip2" ,bzip2)))
727 (home-page "https://sourceforge.net/projects/enlightenment/")
728 (synopsis
729 "Loading, saving, rendering and manipulating image files")
730 (description
731 "Imlib2 is a library that does image file loading and saving as well as
732 rendering, manipulation, arbitrary polygon support, etc.
733
734 It does ALL of these operations FAST. Imlib2 also tries to be highly
735 intelligent about doing them, so writing naive programs can be done easily,
736 without sacrificing speed.
737
738 This is a complete rewrite over the Imlib 1.x series. The architecture is
739 more modular, simple, and flexible.")
740 (license license:imlib2)))
741
742 (define-public giblib
743 (package
744 (name "giblib")
745 (version "1.2.4")
746 (source (origin
747 (method url-fetch)
748 (uri (list
749 (string-append
750 "http://linuxbrit.co.uk/downloads/giblib-"
751 version ".tar.gz")
752 (string-append
753 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
754 "files/giblib/giblib-" version ".tar.gz")))
755 (sha256
756 (base32
757 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
758 (build-system gnu-build-system)
759 (inputs
760 `(("libx11" ,libx11)
761 ("imlib2" ,imlib2)))
762 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
763 (synopsis "Wrapper library for imlib2")
764 (description
765 "Giblib is a simple library which wraps imlib2's context API, avoiding
766 all the context_get/set calls, adds fontstyles to the truetype renderer and
767 supplies a generic doubly-linked list and some string functions.")
768 ;; This license removes a clause about X Consortium from the original
769 ;; X11 license.
770 (license (license:x11-style "file://COPYING"
771 "See 'COPYING' in the distribution."))))
772
773 (define-public freeimage
774 (package
775 (name "freeimage")
776 (version "3.17.0")
777 (source (origin
778 (method url-fetch)
779 (uri (string-append
780 "mirror://sourceforge/freeimage/Source%20Distribution/"
781 version "/FreeImage"
782 (string-concatenate (string-split version #\.))
783 ".zip"))
784 (sha256
785 (base32
786 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
787 (modules '((guix build utils)))
788 (snippet
789 '(begin
790 (for-each
791 (lambda (dir)
792 (delete-file-recursively (string-append "Source/" dir)))
793 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
794 ;; "LibJXR"
795 "LibWebP" "OpenEXR" "ZLib"))))
796 (patches (search-patches "freeimage-unbundle.patch"
797 "freeimage-CVE-2015-0852.patch"
798 "freeimage-CVE-2016-5684.patch"
799 "freeimage-fix-build-with-gcc-5.patch"))))
800 (build-system gnu-build-system)
801 (arguments
802 '(#:phases
803 (modify-phases %standard-phases
804 ;; According to Fedora these files depend on private headers, but their
805 ;; presence is required for building, so we replace them with empty files.
806 (add-after 'unpack 'delete-unbuildable-files
807 (lambda _
808 (for-each (lambda (file)
809 (delete-file file)
810 (close (open file O_CREAT)))
811 '("Source/FreeImage/PluginG3.cpp"
812 "Source/FreeImageToolkit/JPEGTransform.cpp"))
813 #t))
814 ;; These scripts generate the Makefiles.
815 (replace 'configure
816 (lambda _
817 (invoke "sh" "gensrclist.sh")
818 (invoke "sh" "genfipsrclist.sh")))
819 (add-before 'build 'patch-makefile
820 (lambda* (#:key outputs #:allow-other-keys)
821 (substitute* "Makefile.gnu"
822 (("/usr") (assoc-ref outputs "out"))
823 (("-o root -g root") ""))
824 #t)))
825 #:make-flags
826 (list "CC=gcc"
827 ;; We need '-fpermissive' for Source/FreeImage.h.
828 ;; libjxr doesn't have a pkg-config file.
829 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
830 ;"-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"
831 ))
832 #:tests? #f)) ; no check target
833 (native-inputs
834 `(("pkg-config" ,pkg-config)
835 ("unzip" ,unzip)))
836 (inputs
837 `(("libjpeg" ,libjpeg)
838 ;("libjxr" ,libjxr)
839 ("libpng" ,libpng)
840 ("libraw" ,libraw)
841 ("libtiff" ,libtiff)
842 ("libwebp" ,libwebp)
843 ("openexr" ,openexr)
844 ("openjpeg" ,openjpeg)
845 ("zlib" ,zlib)))
846 (synopsis "Library for handling popular graphics image formats")
847 (description
848 "FreeImage is a library for developers who would like to support popular
849 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
850 (license license:gpl2+)
851 (home-page "http://freeimage.sourceforge.net")))
852
853 (define-public vigra
854 (package
855 (name "vigra")
856 (version "1.11.1")
857 (source
858 (origin
859 (method url-fetch)
860 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
861 "Version-" (string-join (string-split version #\.) "-")
862 "/vigra-" version "-src.tar.gz"))
863 (sha256 (base32
864 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
865 (build-system cmake-build-system)
866 (inputs
867 `(("boost" ,boost)
868 ("fftw" ,fftw)
869 ("fftwf" ,fftwf)
870 ("hdf5" ,hdf5)
871 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
872 ; to create a configure-flag
873 ("libjpeg" ,libjpeg)
874 ("libpng" ,libpng)
875 ("libtiff" ,libtiff)
876 ("openexr" ,openexr)
877 ("python" ,python-2) ; print syntax
878 ("python2-numpy" ,python2-numpy)
879 ("zlib" ,zlib)))
880 (native-inputs
881 `(("doxygen" ,doxygen)
882 ("python2-nose" ,python2-nose)
883 ("python2-sphinx" ,python2-sphinx)))
884 (arguments
885 `(#:test-target "check"
886 #:phases
887 (modify-phases %standard-phases
888 (add-after 'unpack 'disable-broken-tests
889 (lambda _
890 ;; See https://github.com/ukoethe/vigra/issues/432
891 (substitute* "test/fourier/CMakeLists.txt"
892 (("VIGRA_ADD_TEST.*") ""))
893 ;; This test fails with Numpy 1.15:
894 ;; <https://github.com/ukoethe/vigra/issues/436>.
895 (substitute* "vigranumpy/test/CMakeLists.txt"
896 (("test1\\.py") ""))
897 #t)))
898 #:configure-flags
899 (list "-Wno-dev" ; suppress developer mode with lots of warnings
900 (string-append "-DVIGRANUMPY_INSTALL_DIR="
901 (assoc-ref %outputs "out")
902 "/lib/python2.7/site-packages")
903 ;; OpenEXR is not enabled by default.
904 "-DWITH_OPENEXR=1"
905 ;; Fix rounding error on 32-bit machines
906 "-DCMAKE_C_FLAGS=-ffloat-store"
907 ;; The header files of ilmbase are not found when included
908 ;; by the header files of openexr, and an explicit flag
909 ;; needs to be set.
910 (string-append "-DCMAKE_CXX_FLAGS=-I"
911 (assoc-ref %build-inputs "ilmbase")
912 "/include/OpenEXR"
913 " -ffloat-store"))))
914 (synopsis "Computer vision library")
915 (description
916 "VIGRA stands for Vision with Generic Algorithms. It is an image
917 processing and analysis library that puts its main emphasis on customizable
918 algorithms and data structures. It is particularly strong for
919 multi-dimensional image processing.")
920 (license license:expat)
921 (home-page "https://ukoethe.github.io/vigra/")))
922
923 (define-public vigra-c
924 (let* ((commit "a2ff675f42079e2623318d8ff8b4288dbe7a7f06")
925 (revision "0")
926 (version (git-version "0.0.0" revision commit)))
927 (package
928 (name "vigra-c")
929 (version version)
930 (home-page "https://github.com/BSeppke/vigra_c")
931 (source (origin
932 (method git-fetch)
933 (uri (git-reference
934 (url home-page)
935 (commit commit)))
936 (sha256
937 (base32
938 "1f1phmfbbz3dsq9330rd6bjmdg29hxskxi9l17cyx1f4mdqpgdgl"))
939 (file-name (git-file-name name version))))
940 (build-system cmake-build-system)
941 (arguments
942 `(#:tests? #f)) ; No test target.
943 (native-inputs
944 `(("doxygen" ,doxygen)))
945 (inputs
946 `(("fftw" ,fftw)
947 ("fftwf" ,fftwf)
948 ("vigra" ,vigra)))
949 (synopsis "C interface to the VIGRA computer vision library")
950 (description
951 "This package provides a C interface to the VIGRA C++ computer vision
952 library. It is designed primarily to ease the implementation of higher-level
953 language bindings to VIGRA.")
954 (license license:expat))))
955
956 (define-public libwebp
957 (package
958 (name "libwebp")
959 (version "1.0.1")
960 (source
961 (origin
962 ;; No tarballs are provided for >0.6.1.
963 (method git-fetch)
964 (uri (git-reference
965 (url "https://chromium.googlesource.com/webm/libwebp")
966 (commit (string-append "v" version))))
967 (file-name (git-file-name name version))
968 (sha256
969 (base32
970 "09l4pq4k2acglkmwr96arn79rssl54sv7vrdrgsxqlg7v8c882zh"))))
971 (build-system gnu-build-system)
972 (inputs
973 `(("freeglut" ,freeglut)
974 ("giflib" ,giflib)
975 ("libjpeg" ,libjpeg)
976 ("libpng" ,libpng)
977 ("libtiff" ,libtiff)))
978 (native-inputs
979 `(("autoconf" ,autoconf)
980 ("automake" ,automake)
981 ("libtool" ,libtool)))
982 (arguments
983 '(#:configure-flags '("--enable-libwebpmux"
984 "--enable-libwebpdemux"
985 "--enable-libwebpdecoder")
986 #:phases (modify-phases %standard-phases
987 (add-after 'unpack 'bootstrap
988 (lambda _
989 (invoke "autoreconf" "-vif"))))))
990 (home-page "https://developers.google.com/speed/webp/")
991 (synopsis "Lossless and lossy image compression")
992 (description
993 "WebP is a new image format that provides lossless and lossy compression
994 for images. WebP lossless images are 26% smaller in size compared to
995 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
996 equivalent SSIM index. WebP supports lossless transparency (also known as
997 alpha channel) with just 22% additional bytes. Transparency is also supported
998 with lossy compression and typically provides 3x smaller file sizes compared
999 to PNG when lossy compression is acceptable for the red/green/blue color
1000 channels.")
1001 (license license:bsd-3)))
1002
1003 (define-public libmng
1004 (package
1005 (name "libmng")
1006 (version "2.0.3")
1007 (source (origin
1008 (method url-fetch)
1009 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1010 version "/" name "-" version ".tar.xz"))
1011 (sha256
1012 (base32
1013 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1014 (build-system gnu-build-system)
1015 (propagated-inputs
1016 ;; These are all in the 'Libs.private' field of libmng.pc.
1017 `(("lcms" ,lcms)
1018 ("libjpeg" ,libjpeg)
1019 ("zlib" ,zlib)))
1020 (home-page "http://www.libmng.com/")
1021 (synopsis "Library for handling MNG files")
1022 (description
1023 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1024 (license license:bsd-3)))
1025
1026 (define-public exiv2
1027 (package
1028 (name "exiv2")
1029 (version "0.26")
1030 (source (origin
1031 (method url-fetch)
1032 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
1033 version "-trunk.tar.gz")
1034 (string-append "http://www.exiv2.org/exiv2-"
1035 version ".tar.gz")
1036 (string-append "https://fossies.org/linux/misc/exiv2-"
1037 version ".tar.gz")))
1038 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1039 "exiv2-CVE-2017-14859-14862-14864.patch"))
1040 (sha256
1041 (base32
1042 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1043 (build-system gnu-build-system)
1044 (arguments '(#:tests? #f)) ; no `check' target
1045 (propagated-inputs
1046 `(("expat" ,expat)
1047 ("zlib" ,zlib)))
1048 (native-inputs
1049 `(("intltool" ,intltool)))
1050 (home-page "http://www.exiv2.org/")
1051 (synopsis "Library and command-line utility to manage image metadata")
1052 (description
1053 "Exiv2 is a C++ library and a command line utility to manage image
1054 metadata. It provides fast and easy read and write access to the Exif, IPTC
1055 and XMP metadata of images in various formats.")
1056
1057 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1058 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1059 ;; The core is GPLv2+:
1060 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1061 (license license:gpl2+)))
1062
1063 (define-public devil
1064 (package
1065 (name "devil")
1066 (version "1.8.0")
1067 (source (origin
1068 (method url-fetch)
1069 (uri (string-append "http://downloads.sourceforge.net/openil/"
1070 "DevIL-" version ".tar.gz"))
1071 (sha256
1072 (base32
1073 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1074 (build-system cmake-build-system)
1075 (arguments
1076 '(;; XXX: Not supported in the released CMakeLists.txt.
1077 ;; Enable this for > 1.8.0.
1078 #:tests? #f
1079 #:phases
1080 (modify-phases %standard-phases
1081 (add-before 'configure 'change-directory
1082 (lambda _ (chdir "DevIL") #t)))))
1083 (native-inputs
1084 `(("pkg-config" ,pkg-config)))
1085 (inputs
1086 `(("lcms" ,lcms)
1087 ("libjpeg" ,libjpeg-turbo)
1088 ("libmng" ,libmng)
1089 ("libpng" ,libpng)
1090 ("libtiff" ,libtiff)
1091 ("openexr" ,openexr)
1092 ("zlib" ,zlib)))
1093 (synopsis "Library for manipulating many image formats")
1094 (description "Developer's Image Library (DevIL) is a library to develop
1095 applications with support for many types of images. DevIL can load, save,
1096 convert, manipulate, filter and display a wide variety of image formats.")
1097 (home-page "http://openil.sourceforge.net")
1098 (license license:lgpl2.1+)))
1099
1100 (define-public jasper
1101 (package
1102 (name "jasper")
1103 (version "2.0.14")
1104 (source (origin
1105 (method git-fetch)
1106 (uri (git-reference
1107 (url "https://github.com/mdadams/jasper.git")
1108 (commit (string-append "version-" version))))
1109 (file-name (git-file-name name version))
1110 (sha256
1111 (base32
1112 "0aarg8nbik9wrm7fx0451sbm5ypfdfr6i169pxzi354mpdp8gg7f"))))
1113 (build-system cmake-build-system)
1114 (inputs `(("libjpeg" ,libjpeg)))
1115 (synopsis "JPEG-2000 library")
1116 (description "The JasPer Project is an initiative to provide a reference
1117 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1118 ISO/IEC 15444-1).")
1119 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1120 (license (license:x11-style "file://LICENSE"))))
1121
1122 (define-public zimg
1123 (package
1124 (name "zimg")
1125 (version "2.5")
1126 (source
1127 (origin
1128 (method git-fetch)
1129 (uri (git-reference
1130 (url "https://github.com/sekrit-twc/zimg.git")
1131 (commit (string-append "release-" version))))
1132 (file-name (git-file-name name version))
1133 (sha256
1134 (base32
1135 "05krggiifbl6hyg2j3z8qz2k7si84g1qg9snhsnf1ml7mrhqhhlr"))))
1136 (build-system gnu-build-system)
1137 (native-inputs
1138 `(("autoconf" ,autoconf)
1139 ("automake" ,automake)
1140 ("libtool" ,libtool)))
1141 (arguments
1142 '(#:phases
1143 (modify-phases %standard-phases
1144 (add-after 'unpack 'autogen
1145 (lambda _
1146 (invoke "sh" "autogen.sh"))))))
1147 (synopsis "Scaling, colorspace conversion, and dithering library")
1148 (description "Zimg implements the commonly required image processing basics
1149 of scaling, colorspace conversion, and depth conversion. A simple API enables
1150 conversion between any supported formats to operate with minimal knowledge from
1151 the programmer.")
1152 (home-page "https://github.com/sekrit-twc/zimg")
1153 ;; test/extra/ contains musl-libm,
1154 ;; which is MIT/expat licensed, but only used for tests
1155 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
1156
1157 (define-public perceptualdiff
1158 (package
1159 (name "perceptualdiff")
1160 (version "1.3")
1161 (source
1162 (origin
1163 (method url-fetch)
1164 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
1165 version ".tar.gz"))
1166 (file-name (string-append name "-" version ".tar.gz"))
1167 (sha256
1168 (base32
1169 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
1170 (build-system cmake-build-system)
1171 (inputs `(("freeimage" ,freeimage)))
1172 (arguments
1173 '(#:phases (modify-phases %standard-phases
1174 (add-after 'unpack 'fix-tests
1175 ;; cmake-build-system uses a build/ directory outside
1176 ;; of the source tree, one level higher than expected
1177 (lambda _
1178 (substitute* "test/run_tests.bash"
1179 (("../build") "../../build"))
1180 #t)))))
1181 (home-page "https://github.com/myint/perceptualdiff")
1182 (synopsis "Perceptual image comparison utility")
1183 (description "PerceptualDiff visually compares two images to determine
1184 whether they look alike. It uses a computational model of the human visual
1185 system to detect similarities. This allows it too see beyond irrelevant
1186 differences in file encoding, image quality, and other small variations.")
1187 (license license:gpl2+)))
1188
1189 (define-public steghide
1190 (package
1191 (name "steghide")
1192 (version "0.5.1")
1193 (source (origin
1194 (method url-fetch)
1195 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1196 version "/steghide-" version ".tar.bz2"))
1197 (sha256
1198 (base32
1199 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1200 (patches (list (search-patch "steghide-fixes.patch")))))
1201 (build-system gnu-build-system)
1202 (native-inputs
1203 `(("gettext" ,gettext-minimal)
1204 ("libtool" ,libtool)
1205 ("perl" ,perl))) ;for tests
1206 (inputs
1207 `(("libmhash" ,libmhash)
1208 ("libmcrypt" ,libmcrypt)
1209 ("libjpeg" ,libjpeg)
1210 ("zlib" ,zlib)))
1211 (arguments
1212 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1213
1214 #:phases (modify-phases %standard-phases
1215 (add-before 'configure 'set-perl-search-path
1216 (lambda _
1217 ;; Work around "dotless @INC" build failure.
1218 (setenv "PERL5LIB"
1219 (string-append (getcwd) "/tests:"
1220 (getenv "PERL5LIB")))
1221 #t)))))
1222 (home-page "http://steghide.sourceforge.net")
1223 (synopsis "Image and audio steganography")
1224 (description
1225 "Steghide is a program to hide data in various kinds of image and audio
1226 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1227 changed, making the embedding resistant against first-order statistical tests.")
1228 (license license:gpl2+)))
1229
1230 (define-public stb-image-for-extempore
1231 (let ((revision "1")
1232 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1233 (package
1234 (name "stb-image-for-extempore")
1235 (version (string-append "0-" revision "." (string-take commit 9)))
1236 (source
1237 (origin (method git-fetch)
1238 (uri (git-reference
1239 (url "https://github.com/extemporelang/stb.git")
1240 (commit commit)))
1241 (sha256
1242 (base32
1243 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1244 (file-name (string-append name "-" version "-checkout"))))
1245 (build-system cmake-build-system)
1246 (arguments `(#:tests? #f)) ; no tests included
1247 ;; Extempore refuses to build on architectures other than x86_64
1248 (supported-systems '("x86_64-linux"))
1249 (home-page "https://github.com/extemporelang/stb")
1250 (synopsis "Image library for Extempore")
1251 (description
1252 "This package is a collection of assorted single-file libraries. Of
1253 all included libraries only the image loading and decoding library is
1254 installed as @code{stb_image}.")
1255 (license license:public-domain))))
1256
1257 (define-public optipng
1258 (package
1259 (name "optipng")
1260 (version "0.7.7")
1261 (source
1262 (origin
1263 (method url-fetch)
1264 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1265 version ".tar.gz"))
1266 (sha256
1267 (base32
1268 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1269 (modules '((guix build utils)))
1270 (snippet
1271 '(begin
1272 (delete-file-recursively "src/libpng")
1273 (delete-file-recursively "src/zlib")
1274 #t))))
1275 (build-system gnu-build-system)
1276 (inputs
1277 `(("libpng" ,libpng)
1278 ("zlib" ,zlib)))
1279 (arguments
1280 '(#:phases
1281 (modify-phases %standard-phases
1282 (replace 'configure
1283 (lambda* (#:key outputs #:allow-other-keys)
1284 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1285 (invoke "sh" "configure"
1286 (string-append "--prefix=" (assoc-ref outputs "out"))
1287 "-with-system-libs")
1288 #t)))))
1289 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1290 (description "OptiPNG is a PNG optimizer that recompresses image
1291 files to a smaller size, without losing any information. This program
1292 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1293 PNG, and performs PNG integrity checks and corrections.")
1294 (home-page "http://optipng.sourceforge.net/")
1295 (license license:zlib)))
1296
1297 (define-public libjpeg-turbo
1298 (package
1299 (name "libjpeg-turbo")
1300 (version "2.0.1")
1301 (source (origin
1302 (method url-fetch)
1303 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1304 name "-" version ".tar.gz"))
1305 (sha256
1306 (base32
1307 "1zv6z093l3x3jzygvni7b819j7xhn6d63jhcdrckj7fz67n6ry75"))))
1308 (build-system cmake-build-system)
1309 (native-inputs
1310 `(("nasm" ,nasm)))
1311 (arguments
1312 '(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1313 "-DENABLE_STATIC=0")))
1314 (home-page "https://libjpeg-turbo.org/")
1315 (synopsis "SIMD-accelerated JPEG image handling library")
1316 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1317 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1318 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1319 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1320 a significant amount.
1321 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1322 but more straightforward TurboJPEG API, and provides a full-featured Java
1323 interface. It supports color space extensions that allow it to compress from
1324 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1325 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1326 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1327 license:ijg ;the libjpeg library and associated tools
1328 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1329
1330 (define-public niftilib
1331 (package
1332 (name "niftilib")
1333 (version "2.0.0")
1334 (source (origin
1335 (method url-fetch)
1336 (uri (list (string-append "mirror://sourceforge/niftilib/"
1337 "nifticlib/nifticlib_"
1338 (string-join (string-split version #\.) "_")
1339 "/nifticlib-" version ".tar.gz")))
1340 (sha256
1341 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1342 (build-system gnu-build-system)
1343 (arguments
1344 '(#:tests? #f ; there is no test target
1345 #:parallel-build? #f ; not supported
1346 #:make-flags
1347 (list "SHELL=bash"
1348 (string-append "ZLIB_INC="
1349 (assoc-ref %build-inputs "zlib") "/include")
1350 ;; Append "-fPIC" to CFLAGS.
1351 (string-append "CFLAGS="
1352 "-Wall -ansi -pedantic -fPIC"))
1353 #:phases
1354 (modify-phases %standard-phases
1355 (replace 'install
1356 (lambda* (#:key outputs #:allow-other-keys)
1357 (let ((out (assoc-ref outputs "out")))
1358 (for-each
1359 (lambda (dir)
1360 (copy-recursively dir (string-append out "/" dir)))
1361 '("bin" "lib" "include")))
1362 #t))
1363 (delete 'configure))))
1364 (inputs
1365 `(("zlib" ,zlib)))
1366 (synopsis "Library for reading and writing files in the nifti-1 format")
1367 (description "Niftilib is a set of i/o libraries for reading and writing
1368 files in the nifti-1 data format - a binary file format for storing
1369 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1370 (fMRI) brain images.")
1371 (home-page "http://niftilib.sourceforge.net")
1372 (license license:public-domain)))
1373
1374 (define-public gpick
1375 (package
1376 (name "gpick")
1377 (version "0.2.5")
1378 (source (origin
1379 (method git-fetch)
1380 (uri (git-reference
1381 (url "https://github.com/thezbyg/gpick.git")
1382 (commit (string-append name "-" version))))
1383 (file-name (git-file-name name version))
1384 (sha256
1385 (base32
1386 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
1387 (build-system scons-build-system)
1388 (native-inputs
1389 `(("boost" ,boost)
1390 ("gettext" ,gnu-gettext)
1391 ("pkg-config" ,pkg-config)))
1392 (inputs
1393 `(("expat" ,expat)
1394 ("gtk2" ,gtk+-2)
1395 ("lua" ,lua-5.2)))
1396 (arguments
1397 `(#:tests? #f
1398 #:scons ,scons-python2
1399 #:scons-flags (list (string-append "DESTDIR=" %output))
1400 #:phases
1401 (modify-phases %standard-phases
1402 (add-before 'build 'fix-lua-reference
1403 (lambda _
1404 (substitute* "SConscript"
1405 (("lua5.2") "lua-5.2"))
1406 #t)))))
1407 (home-page "http://www.gpick.org/")
1408 (synopsis "Color picker")
1409 (description "Gpick is an advanced color picker and palette editing tool.")
1410 (license license:bsd-3)))
1411
1412 (define-public libiptcdata
1413 (package
1414 (name "libiptcdata")
1415 (version "1.0.5")
1416 (source (origin
1417 (method url-fetch)
1418 (uri (string-append "https://github.com/ianw/libiptcdata"
1419 "/releases/download/release_"
1420 (string-join (string-split version #\.) "_")
1421 "/" name "-" version ".tar.gz"))
1422 (sha256
1423 (base32
1424 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1425 (build-system gnu-build-system)
1426 (home-page "https://github.com/ianw/libiptcdata")
1427 (synopsis "IPTC metadata manipulation library")
1428 (description
1429 "Libiptcdata is a C library for manipulating the International Press
1430 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1431 such as images. This metadata can include captions and keywords, often used by
1432 popular photo management applications. The library provides routines for
1433 parsing, viewing, modifying, and saving this metadata.")
1434 (license license:lgpl2.0+)))
1435
1436 (define-public flameshot
1437 (package
1438 (name "flameshot")
1439 (version "0.5.1")
1440 (source
1441 (origin
1442 (method git-fetch)
1443 (uri (git-reference
1444 (url "https://github.com/lupoDharkael/flameshot.git")
1445 (commit (string-append "v" version))))
1446 (file-name (git-file-name name version))
1447 (sha256
1448 (base32
1449 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
1450 (build-system gnu-build-system)
1451 (native-inputs
1452 `(("qttools" ,qttools)))
1453 (inputs
1454 `(("qtbase" ,qtbase)))
1455 (arguments
1456 `(#:tests? #f ; no tests
1457 #:phases
1458 (modify-phases %standard-phases
1459 (replace 'configure
1460 (lambda* (#:key outputs #:allow-other-keys)
1461 (invoke "qmake"
1462 "CONFIG+=packaging"
1463 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1464 "PREFIX=/"))))))
1465 (home-page "https://github.com/lupoDharkael/flameshot")
1466 (synopsis "Powerful yet simple to use screenshot software")
1467 (description "Flameshot is a screenshot program.
1468 Features:
1469
1470 @itemize
1471 @item Customizable appearance.
1472 @item Easy to use.
1473 @item In-app screenshot edition.
1474 @item DBus interface.
1475 @item Upload to Imgur.
1476 @end itemize\n")
1477 (license license:gpl3+)))
1478
1479 (define-public r-jpeg
1480 (package
1481 (name "r-jpeg")
1482 (version "0.1-8")
1483 (source
1484 (origin
1485 (method url-fetch)
1486 (uri (cran-uri "jpeg" version))
1487 (sha256
1488 (base32
1489 "05hawv5qcb82ljc1l2nchx1wah8mq2k2kfkhpzyww554ngzbwcnh"))))
1490 (build-system r-build-system)
1491 (inputs `(("libjpeg" ,libjpeg)))
1492 (home-page "http://www.rforge.net/jpeg/")
1493 (synopsis "Read and write JPEG images with R")
1494 (description "This package provides a way to read, write and display bitmap
1495 images stored in the JPEG format with R. It can read and write both files and
1496 in-memory raw vectors.")
1497 (license license:gpl2+)))
1498
1499 (define-public gifsicle
1500 (package
1501 (name "gifsicle")
1502 (version "1.91")
1503 (source
1504 (origin
1505 (method url-fetch)
1506 (uri (string-append "http://www.lcdf.org/gifsicle/gifsicle-"
1507 version ".tar.gz"))
1508 (sha256
1509 (base32
1510 "00586z1yz86qcblgmf16yly39n4lkjrscl52hvfxqk14m81fckha"))))
1511 (build-system gnu-build-system)
1512 (arguments
1513 '(#:phases
1514 (modify-phases %standard-phases
1515 (add-before 'check 'patch-tests
1516 (lambda _
1517 (substitute* "test/testie"
1518 (("/usr/bin/perl")
1519 (which "perl"))
1520 (("/bin/sh")
1521 (which "sh"))
1522 (("/bin/rm")
1523 (which "rm")))
1524 #t)))))
1525 (native-inputs `(("perl" ,perl))) ; Only for tests.
1526 (inputs `(("libx11" ,libx11)))
1527 (home-page "http://www.lcdf.org/gifsicle/")
1528 (synopsis "Edit GIF images and animations")
1529 (description "Gifsicle is a command-line GIF image manipulation tool that:
1530
1531 @itemize
1532 @item Provides a batch mode for changing GIFs in place.
1533 @item Prints detailed information about GIFs, including comments.
1534 @item Control over interlacing, comments, looping, transparency, etc.
1535 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1536 tables, etc.
1537 @item Shrinks colormaps and change images to use the Web-safe palette.
1538 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1539 @end itemize
1540
1541 Two other programs are included with Gifsicle: @command{gifview} is a
1542 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1543 identical visual appearance.")
1544 (license license:gpl2+)))
1545
1546 (define-public jp2a
1547 (package
1548 (name "jp2a")
1549 (version "1.0.7")
1550 (source
1551 (origin
1552 (method git-fetch)
1553 (uri (git-reference
1554 (url "https://github.com/cslarsen/jp2a.git")
1555 (commit (string-append "v" version))))
1556 (file-name (git-file-name name version))
1557 (sha256
1558 (base32
1559 "12a1z9ba2j16y67f41y8ax5sgv1wdjd71pg7circdxkj263n78ql"))))
1560 (build-system gnu-build-system)
1561 (inputs
1562 `(("libjpeg" ,libjpeg)
1563 ("curl" ,curl)))
1564 (native-inputs
1565 `(("autoconf" ,autoconf)
1566 ("automake" ,automake)
1567 ("pkg-config" ,pkg-config)))
1568 (home-page "https://csl.name/jp2a/")
1569 (synopsis "Convert JPEG images to ASCII")
1570 (description
1571 "Jp2a is a small utility that converts JPEG images to ASCII.")
1572 (license license:gpl2)))