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