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