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