abac17d6d7286a019d84c07557d455878384e371
[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 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 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
15 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
16 ;;; Copyright © 2016, 2017 Kei Kebreau <kei@openmailbox.org>
17 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
18 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;;
20 ;;; This file is part of GNU Guix.
21 ;;;
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
26 ;;;
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
31 ;;;
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 (define-module (gnu packages image)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages assembly)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages fontutils)
44 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
45 #:use-module (gnu packages gcc)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages ghostscript)
48 #:use-module (gnu packages gl)
49 #:use-module (gnu packages glib)
50 #:use-module (gnu packages graphics)
51 #:use-module (gnu packages maths)
52 #:use-module (gnu packages mcrypt)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages xorg)
58 #:use-module (gnu packages zip)
59 #:use-module ((guix licenses) #:prefix license:)
60 #:use-module (guix packages)
61 #:use-module (guix download)
62 #:use-module (guix git-download)
63 #:use-module (guix build-system gnu)
64 #:use-module (guix build-system cmake)
65 #:use-module (srfi srfi-1))
66
67 (define-public libpng
68 (package
69 (name "libpng")
70 (version "1.6.28")
71 (source (origin
72 (method url-fetch)
73 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
74 version "/libpng-" version ".tar.xz")
75 (string-append
76 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
77 "/libpng16/libpng-" version ".tar.xz")
78 (string-append
79 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
80 "/libpng16/libpng-" version ".tar.xz")))
81 (sha256
82 (base32 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
83 (build-system gnu-build-system)
84
85 ;; libpng.la says "-lz", so propagate it.
86 (propagated-inputs `(("zlib" ,zlib)))
87
88 (synopsis "Library for handling PNG files")
89 (description
90 "Libpng is the official PNG (Portable Network Graphics) reference
91 library. It supports almost all PNG features and is extensible.")
92 (license license:zlib)
93 (home-page "http://www.libpng.org/pub/png/libpng.html")))
94
95 (define-public libpng-apng
96 (package
97 (inherit libpng)
98 (replacement #f) ;libpng's replacement doesn't apply here
99 (name "libpng-apng")
100 (version (package-version libpng))
101 (arguments
102 `(#:phases
103 (modify-phases %standard-phases
104 (add-after 'unpack 'patch-apng
105 (lambda* (#:key inputs #:allow-other-keys)
106 (define (apply-patch file)
107 (zero? (system* "patch" "-p1" "--force"
108 "--input" file)))
109 (let ((apng.gz (assoc-ref inputs "apng")))
110 (format #t "Applying APNG patch '~a'...~%"
111 apng.gz)
112 (system (string-append "gunzip < " apng.gz " > the-patch"))
113 (and (apply-patch "the-patch")
114 (for-each apply-patch
115 (find-files "\\.patch"))))
116 #t))
117 (add-before 'configure 'no-checks
118 (lambda _
119 (substitute* "Makefile.in"
120 (("^scripts/symbols.chk") "")
121 (("check: scripts/symbols.chk") ""))
122 #t)))))
123 (inputs
124 `(("apng" ,(origin
125 (method url-fetch)
126 (uri
127 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
128 version "/libpng-" version "-apng.patch.gz"))
129 (sha256
130 (base32
131 "026r0gbkf6d6v54wca02cdxln8sj4m2c1yk62sj2aasv2ki2ffh5"))))))
132 (native-inputs
133 `(("libtool" ,libtool)))
134 (synopsis "APNG patch for libpng")
135 (description
136 "APNG (Animated Portable Network Graphics) is an unofficial
137 extension of the APNG (Portable Network Graphics) format.
138 APNG patch provides APNG support to libpng.")
139 (home-page "https://sourceforge.net/projects/libpng-apng/")))
140
141 (define-public libpng-1.2
142 (package
143 (inherit libpng)
144 (version "1.2.57")
145 (source
146 (origin
147 (method url-fetch)
148 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
149 version "/libpng-" version ".tar.xz")
150 (string-append
151 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
152 "/libpng12/libpng-" version ".tar.xz")
153 (string-append
154 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
155 "/libpng12/libpng-" version ".tar.xz")))
156 (sha256
157 (base32 "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg"))))))
158
159 (define-public pngcrunch
160 (package
161 (name "pngcrunch")
162 (version "1.8.11")
163 (source (origin
164 (method url-fetch)
165 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
166 version "/pngcrush-" version ".tar.xz"))
167 (sha256 (base32
168 "1c7m316i91jp3h1dj1ppppdv6zilm2njk1wrpqy2zj0fcll06lwd"))))
169 (build-system gnu-build-system)
170 (arguments
171 '(#:make-flags '("-f" "Makefile-nolib")
172 #:tests? #f ; no check target
173 #:phases
174 (modify-phases %standard-phases
175 (replace 'configure
176 (lambda* (#:key inputs outputs #:allow-other-keys)
177 (substitute* "Makefile-nolib"
178 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
179 (string-append vardef (assoc-ref inputs "libpng") "/"))
180 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
181 (string-append vardef (assoc-ref inputs "zlib") "/"))
182 ;; The Makefile is written by hand and not using $PREFIX
183 (("\\$\\(DESTDIR\\)/usr/")
184 (string-append (assoc-ref outputs "out") "/"))))))))
185 (inputs
186 `(("libpng" ,libpng)
187 ("zlib" , zlib)))
188 (home-page "https://pmt.sourceforge.net/pngcrush")
189 (synopsis "Utility to compress PNG files")
190 (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
191 files. It can compress them as much as 40% losslessly.")
192 (license license:zlib)))
193
194 (define-public libjpeg
195 (package
196 (name "libjpeg")
197 (version "9b")
198 (source (origin
199 (method url-fetch)
200 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
201 version ".tar.gz"))
202 (sha256 (base32
203 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
204 (build-system gnu-build-system)
205 (synopsis "Library for handling JPEG files")
206 (description
207 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
208 JPEG is a standardized compression method for full-color and gray-scale
209 images.
210 The included programs provide conversion between the JPEG format and
211 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
212 (license license:ijg)
213 (home-page "http://www.ijg.org/")))
214
215 (define-public libjpeg-8
216 (package (inherit libjpeg)
217 (version "8d")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
221 version ".tar.gz"))
222 (sha256 (base32
223 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
224
225 (define-public libjxr
226 (package
227 (name "libjxr")
228 (version "1.1")
229 (source (origin
230 ;; We are using the Debian source because CodePlex does not
231 ;; deliver an easily downloadable tarball.
232 (method url-fetch)
233 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
234 version ".orig.tar.gz"))
235 (sha256
236 (base32
237 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
238 (patch-flags '("-p1" "--binary"))
239 (patches (search-patches "libjxr-fix-function-signature.patch"
240 "libjxr-fix-typos.patch"))))
241 (build-system gnu-build-system)
242 (arguments '(#:make-flags '("CC=gcc")
243 #:tests? #f ; no check target
244 #:phases
245 (modify-phases %standard-phases
246 (delete 'configure) ; no configure script
247 ;; The upstream makefile does not include an install phase.
248 (replace 'install
249 (lambda* (#:key outputs #:allow-other-keys)
250 (let* ((out (assoc-ref outputs "out"))
251 (bin (string-append out "/bin"))
252 (lib (string-append out "/lib"))
253 (include (string-append out "/include/jxrlib")))
254 (for-each (lambda (file)
255 (install-file file include)
256 (delete-file file))
257 (append
258 '("jxrgluelib/JXRGlue.h"
259 "jxrgluelib/JXRMeta.h"
260 "jxrtestlib/JXRTest.h"
261 "image/sys/windowsmediaphoto.h")
262 (find-files "common/include" "\\.h$")))
263 (for-each (lambda (file)
264 (install-file file lib)
265 (delete-file file))
266 (find-files "." "\\.a$"))
267 (for-each (lambda (file)
268 (install-file file bin)
269 (delete-file file))
270 '("JxrDecApp" "JxrEncApp")))
271 #t)))))
272 (synopsis "Implementation of the JPEG XR standard")
273 (description "JPEG XR is an approved ISO/IEC International standard (its
274 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
275 (license
276 (license:non-copyleft
277 "file://Makefile"
278 "See the header of the Makefile in the distribution."))
279 (home-page "https://jxrlib.codeplex.com/")))
280
281 (define-public jpegoptim
282 (package
283 (name "jpegoptim")
284 (version "1.4.4")
285 (source (origin
286 (method url-fetch)
287 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
288 version ".tar.gz"))
289 (sha256 (base32
290 "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
291 (build-system gnu-build-system)
292 (inputs `(("libjpeg" ,libjpeg)))
293 (arguments
294 ;; no tests
295 '(#:tests? #f))
296 (synopsis "Optimize JPEG images")
297 (description
298 "jpegoptim provides lossless optimization (based on optimizing
299 the Huffman tables) and \"lossy\" optimization based on setting
300 maximum quality factor.")
301 (license license:gpl2+)
302 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
303
304 (define-public libicns
305 (package
306 (name "libicns")
307 (version "0.8.1")
308 (source (origin
309 (method url-fetch)
310 (uri (string-append
311 "mirror://sourceforge/icns/"
312 "libicns-" version ".tar.gz"))
313 (sha256
314 (base32
315 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
316 (build-system gnu-build-system)
317 (inputs
318 `(("libpng" ,libpng)
319 ("jasper" ,jasper)))
320 (arguments
321 `(#:tests? #t)) ; No tests.
322 (home-page "http://icns.sourceforge.net/")
323 (synopsis "Library for handling Mac OS icns resource files")
324 (description
325 "Libicns is a library for the manipulation of Mac OS IconFamily resource
326 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
327 convert between PNG and ICNS. @command{icns2png} will extract image files from
328 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
329 with .desktop files. Additionally, @command{icontainer2png} is provided for
330 extracting icontainer icon files.")
331 (license (list license:lgpl2.1+ ; libicns
332 license:lgpl2.0+ ; src/apidocs.*
333 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
334
335 (define-public libtiff
336 (package
337 (name "libtiff")
338 (replacement libtiff-4.0.8)
339 (version "4.0.7")
340 (source (origin
341 (method url-fetch)
342 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
343 version ".tar.gz"))
344 (patches (search-patches "libtiff-heap-overflow-tiffcp.patch"
345 "libtiff-null-dereference.patch"
346 "libtiff-heap-overflow-tif-dirread.patch"
347 "libtiff-heap-overflow-pixarlog-luv.patch"
348 "libtiff-divide-by-zero.patch"
349 "libtiff-divide-by-zero-ojpeg.patch"
350 "libtiff-tiffcp-underflow.patch"
351 "libtiff-invalid-read.patch"
352 "libtiff-CVE-2016-10092.patch"
353 "libtiff-heap-overflow-tiffcrop.patch"
354 "libtiff-divide-by-zero-tiffcrop.patch"
355 "libtiff-CVE-2016-10093.patch"
356 "libtiff-divide-by-zero-tiffcp.patch"
357 "libtiff-assertion-failure.patch"
358 "libtiff-CVE-2016-10094.patch"
359 "libtiff-CVE-2017-5225.patch"))
360 (sha256
361 (base32
362 "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz"))))
363 (build-system gnu-build-system)
364 (outputs '("out"
365 "doc")) ;1.3 MiB of HTML documentation
366 (arguments
367 ;; Instead of using --docdir, this package has its own --with-docdir.
368 `(#:configure-flags (list (string-append "--with-docdir="
369 (assoc-ref %outputs "doc")
370 "/share/doc/"
371 ,name "-" ,version))))
372 ;; Build with a patched GCC to work around <http://bugs.gnu.org/24703>.
373 (native-inputs
374 `(("gcc@5" ,gcc-5)))
375 (inputs `(("zlib" ,zlib)
376 ("libjpeg" ,libjpeg)))
377 (synopsis "Library for handling TIFF files")
378 (description
379 "Libtiff provides support for the Tag Image File Format (TIFF), a format
380 used for storing image data.
381 Included are a library, libtiff, for reading and writing TIFF and a small
382 collection of tools for doing simple manipulations of TIFF images.")
383 (license (license:non-copyleft "file://COPYRIGHT"
384 "See COPYRIGHT in the distribution."))
385 (home-page "http://www.simplesystems.org/libtiff/")))
386
387 (define libtiff-4.0.8
388 (package
389 (inherit libtiff)
390 (version "4.0.8")
391 (source
392 (origin
393 (method url-fetch)
394 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
395 version ".tar.gz"))
396 (sha256
397 (base32
398 "0419mh6kkhz5fkyl77gv0in8x4d2jpdpfs147y8mj86rrjlabmsr"))))))
399
400 (define-public libwmf
401 (package
402 (name "libwmf")
403 (version "0.2.8.4")
404 (source
405 (origin
406 (method url-fetch)
407 (uri (string-append "mirror://sourceforge/wvware/"
408 name "/" version
409 "/" name "-" version ".tar.gz"))
410 (sha256
411 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
412 (patches
413 (search-patches "libwmf-CAN-2004-0941.patch"
414 "libwmf-CVE-2006-3376.patch"
415 "libwmf-CVE-2007-0455.patch"
416 "libwmf-CVE-2007-2756.patch"
417 "libwmf-CVE-2007-3472.patch"
418 "libwmf-CVE-2007-3473.patch"
419 "libwmf-CVE-2007-3477.patch"
420 "libwmf-CVE-2009-1364.patch"
421 "libwmf-CVE-2009-3546.patch"
422 "libwmf-CVE-2015-0848+CVE-2015-4588.patch"
423 "libwmf-CVE-2015-4695.patch"
424 "libwmf-CVE-2015-4696.patch"))))
425
426 (build-system gnu-build-system)
427 (inputs
428 `(("freetype" ,freetype)
429 ("libjpeg" ,libjpeg)
430 ("libpng",libpng)
431 ("libxml2" ,libxml2)
432 ("zlib" ,zlib)))
433 (native-inputs
434 `(("pkg-config" ,pkg-config)))
435 (synopsis "Library for reading images in the Microsoft WMF format")
436 (description
437 "libwmf is a library for reading vector images in Microsoft's native
438 Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
439 window; or (b) converting them to more standard/free file formats such as, e.g.,
440 the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
441 (home-page "http://wvware.sourceforge.net/libwmf.html")
442
443 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
444 (license license:lgpl2.0+)))
445
446 (define-public leptonica
447 (package
448 (name "leptonica")
449 (version "1.74.0")
450 (source
451 (origin
452 (method url-fetch)
453 (uri (string-append
454 "https://github.com/DanBloomberg/leptonica/archive/" version
455 ".tar.gz"))
456 (file-name (string-append "leptonica-" version ".tar.gz"))
457 (sha256
458 (base32 "0i2a4vx9gizki0wgmv03xjz8j9d8agkvbag1a8m4kcw4asd4p87g"))))
459 (build-system gnu-build-system)
460 (native-inputs
461 `(("gnuplot" ,gnuplot) ;needed for test suite
462 ("autoconf" ,autoconf)
463 ("automake" ,automake)
464 ("libtool" ,libtool)
465 ("pkg-config" ,pkg-config)))
466 (inputs
467 `(("giflib" ,giflib)
468 ("libjpeg" ,libjpeg)
469 ("libpng" ,libpng)
470 ("libtiff" ,libtiff)
471 ("libwebp" ,libwebp)))
472 (propagated-inputs
473 ;; Linking a program with leptonica also requires these.
474 `(("openjpeg" ,openjpeg)
475 ("zlib" ,zlib)))
476 (arguments
477 '(#:phases
478 (modify-phases %standard-phases
479 (add-after 'unpack 'autogen
480 (lambda _
481 (zero? (system* "sh" "autobuild"))))
482 (add-after 'unpack 'patch-reg-wrapper
483 (lambda _
484 (substitute* "prog/reg_wrapper.sh"
485 ((" /bin/sh ")
486 (string-append " " (which "sh") " "))
487 (("which gnuplot")
488 "true")))))))
489 (home-page "http://www.leptonica.com/")
490 (synopsis "Library and tools for image processing and analysis")
491 (description
492 "Leptonica is a C library and set of command-line tools for efficient
493 image processing and image analysis operations. It supports rasterop, affine
494 transformations, binary and grayscale morphology, rank order, and convolution,
495 seedfill and connected components, image transformations combining changes in
496 scale and pixel depth, and pixelwise masking, blending, enhancement, and
497 arithmetic ops.")
498 (license license:bsd-2)))
499
500 (define-public jbig2dec
501 (package
502 (name "jbig2dec")
503 (version "0.13")
504 (source
505 (origin
506 (method url-fetch)
507 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
508 name "-" version ".tar.gz"))
509 (sha256
510 (base32 "04akiwab8iy5iy34razcvh9mcja9wy737civ3sbjxk4j143s1b2s"))
511 (patches (search-patches "jbig2dec-ignore-testtest.patch"
512 "jbig2dec-CVE-2016-9601.patch"
513 "jbig2dec-CVE-2017-7885.patch"
514 "jbig2dec-CVE-2017-7975.patch"
515 "jbig2dec-CVE-2017-7976.patch"))))
516
517 (build-system gnu-build-system)
518 (synopsis "Decoder of the JBIG2 image compression format")
519 (description
520 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
521 monochrome) images at moderately high resolution, and in particular scanned
522 paper documents. In this domain it is very efficient, offering compression
523 ratios on the order of 100:1.
524
525 This is a decoder only implementation, and currently is in the alpha
526 stage, meaning it doesn't completely work yet. However, it is
527 maintaining parity with available encoders, so it is useful for real
528 work.")
529 (home-page "http://www.ghostscript.com/jbig2dec.html")
530 (license license:gpl2+)))
531
532 (define-public openjpeg
533 (package
534 (name "openjpeg")
535 (version "2.1.2")
536 (source
537 (origin
538 (method url-fetch)
539 (uri
540 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
541 version ".tar.gz"))
542 (file-name (string-append name "-" version ".tar.gz"))
543 (sha256
544 (base32
545 "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc"))
546 (patches (search-patches "openjpeg-CVE-2016-9850-CVE-2016-9851.patch"
547 "openjpeg-CVE-2016-9572-CVE-2016-9573.patch"))))
548 (build-system cmake-build-system)
549 (arguments
550 ;; Trying to run `$ make check' results in a no rule fault.
551 '(#:tests? #f))
552 (inputs
553 `(("lcms" ,lcms)
554 ("libpng" ,libpng)
555 ("libtiff" ,libtiff)
556 ("zlib" ,zlib)))
557 (synopsis "JPEG 2000 codec")
558 (description
559 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
560 been developed in order to promote the use of JPEG 2000, the new
561 still-image compression standard from the Joint Photographic Experts
562 Group (JPEG).
563
564 In addition to the basic codec, various other features are under
565 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
566 an indexing tool useful for the JPIP protocol, JPWL-tools for
567 error-resilience, a Java-viewer for j2k-images, ...")
568 (home-page "https://github.com/uclouvain/openjpeg")
569 (license license:bsd-2)))
570
571 (define-public openjpeg-1
572 (package (inherit openjpeg)
573 (name "openjpeg")
574 (version "1.5.2")
575 (source
576 (origin
577 (method url-fetch)
578 (uri
579 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
580 name "-" version ".tar.gz"))
581 (sha256
582 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
583
584 (define-public giflib
585 (package
586 (name "giflib")
587 (version "5.1.4")
588 (source (origin
589 (method url-fetch)
590 (uri (string-append "mirror://sourceforge/giflib/giflib-"
591 version ".tar.bz2"))
592 (sha256
593 (base32
594 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
595 (build-system gnu-build-system)
596 (outputs '("bin" ; utility programs
597 "out")) ; library
598 (inputs `(("libx11" ,libx11)
599 ("libice" ,libice)
600 ("libsm" ,libsm)
601 ("perl" ,perl)))
602 (arguments
603 `(#:phases
604 (modify-phases %standard-phases
605 (add-after 'unpack 'disable-html-doc-gen
606 (lambda _
607 (substitute* "doc/Makefile.in"
608 (("^all: allhtml manpages") ""))))
609 (add-after 'install 'install-manpages
610 (lambda* (#:key outputs #:allow-other-keys)
611 (let* ((bin (assoc-ref outputs "bin"))
612 (man1dir (string-append bin "/share/man/man1")))
613 (mkdir-p man1dir)
614 (for-each (lambda (file)
615 (let ((base (basename file)))
616 (format #t "installing `~a' to `~a'~%"
617 base man1dir)
618 (copy-file file
619 (string-append
620 man1dir "/" base))))
621 (find-files "doc" "\\.1"))))))))
622 (synopsis "Tools and library for working with GIF images")
623 (description
624 "GIFLIB is a library for reading and writing GIF images. It is API and
625 ABI compatible with libungif which was in wide use while the LZW compression
626 algorithm was patented. Tools are also included to convert, manipulate,
627 compose, and analyze GIF images.")
628 (home-page "http://giflib.sourceforge.net/")
629 (license license:x11)))
630
631 (define-public libungif
632 (package
633 (name "libungif")
634 (version "4.1.4")
635 (source (origin
636 (method url-fetch)
637 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
638 "libungif-" version "/libungif-"
639 version ".tar.bz2"))
640 (sha256
641 (base32
642 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
643 (build-system gnu-build-system)
644 (inputs `(("perl" ,perl))) ;package ships some perl tools
645 (home-page "http://giflib.sourceforge.net/")
646 (synopsis "GIF decompression library")
647 (description
648 "libungif is the old GIF decompression library by the GIFLIB project.")
649 (license license:expat)))
650
651 (define-public imlib2
652 (package
653 (name "imlib2")
654 (version "1.4.10")
655 (source (origin
656 (method url-fetch)
657 (uri (string-append
658 "mirror://sourceforge/enlightenment/imlib2-src/" version
659 "/imlib2-" version ".tar.bz2"))
660 (sha256
661 (base32
662 "0wm2q2xlkbm71k7mw2jyzbxgzylrkcj5yh6nq58w5gybhp98qs9z"))))
663 (build-system gnu-build-system)
664 (native-inputs
665 `(("pkgconfig" ,pkg-config)))
666 (inputs
667 `(("libx11" ,libx11)
668 ("libxext" ,libxext)
669 ("freetype" ,freetype)
670 ("libjpeg" ,libjpeg)
671 ("libpng" ,libpng)
672 ("libtiff" ,libtiff)
673 ("giflib" ,giflib)
674 ("bzip2" ,bzip2)))
675 (home-page "https://sourceforge.net/projects/enlightenment/")
676 (synopsis
677 "Loading, saving, rendering and manipulating image files")
678 (description
679 "Imlib2 is a library that does image file loading and saving as well as
680 rendering, manipulation, arbitrary polygon support, etc.
681
682 It does ALL of these operations FAST. Imlib2 also tries to be highly
683 intelligent about doing them, so writing naive programs can be done easily,
684 without sacrificing speed.
685
686 This is a complete rewrite over the Imlib 1.x series. The architecture is
687 more modular, simple, and flexible.")
688 (license license:imlib2)))
689
690 (define-public giblib
691 (package
692 (name "giblib")
693 (version "1.2.4")
694 (source (origin
695 (method url-fetch)
696 (uri (list
697 (string-append
698 "http://linuxbrit.co.uk/downloads/giblib-"
699 version ".tar.gz")
700 (string-append
701 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
702 "files/giblib/giblib-" version ".tar.gz")))
703 (sha256
704 (base32
705 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
706 (build-system gnu-build-system)
707 (inputs
708 `(("libx11" ,libx11)
709 ("imlib2" ,imlib2)))
710 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
711 (synopsis "Wrapper library for imlib2")
712 (description
713 "Giblib is a simple library which wraps imlib2's context API, avoiding
714 all the context_get/set calls, adds fontstyles to the truetype renderer and
715 supplies a generic doubly-linked list and some string functions.")
716 ;; This license removes a clause about X Consortium from the original
717 ;; X11 license.
718 (license (license:x11-style "file://COPYING"
719 "See 'COPYING' in the distribution."))))
720
721 (define-public freeimage
722 (package
723 (name "freeimage")
724 (version "3.17.0")
725 (source (origin
726 (method url-fetch)
727 (uri (string-append
728 "mirror://sourceforge/freeimage/Source%20Distribution/"
729 version "/FreeImage"
730 (string-concatenate (string-split version #\.))
731 ".zip"))
732 (sha256
733 (base32
734 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
735 (patches (search-patches "freeimage-CVE-2015-0852.patch"
736 "freeimage-CVE-2016-5684.patch"
737 "freeimage-fix-build-with-gcc-5.patch"))))
738 (build-system gnu-build-system)
739 (arguments
740 '(#:phases
741 (modify-phases %standard-phases
742 (delete 'configure)
743 (add-before 'build 'patch-makefile
744 (lambda* (#:key outputs #:allow-other-keys)
745 (substitute* "Makefile.gnu"
746 (("/usr") (assoc-ref outputs "out"))
747 (("-o root -g root") ""))
748 #t)))
749 #:make-flags '("CC=gcc")
750 #:tests? #f)) ; no check target
751 (native-inputs
752 `(("unzip" ,unzip)))
753 ;; Fails to build on MIPS due to assembly code in the source.
754 (supported-systems (delete "mips64el-linux" %supported-systems))
755 (synopsis "Library for handling popular graphics image formats")
756 (description
757 "FreeImage is a library for developers who would like to support popular
758 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
759 (license license:gpl2+)
760 (home-page "http://freeimage.sourceforge.net")))
761
762 (define-public vigra
763 (package
764 (name "vigra")
765 (version "1.11.0")
766 (source
767 (origin
768 (method url-fetch)
769 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
770 "Version-1-11-0/vigra-"
771 version "-src.tar.gz"))
772 (sha256 (base32
773 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
774 (build-system cmake-build-system)
775 (inputs
776 `(("boost" ,boost)
777 ("fftw" ,fftw)
778 ("fftwf" ,fftwf)
779 ("hdf5" ,hdf5)
780 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
781 ; to create a configure-flag
782 ("libjpeg" ,libjpeg)
783 ("libpng" ,libpng)
784 ("libtiff" ,libtiff)
785 ("openexr" ,openexr)
786 ("python" ,python-2) ; print syntax
787 ("python2-numpy" ,python2-numpy)
788 ("zlib" ,zlib)))
789 (native-inputs
790 `(("doxygen" ,doxygen)
791 ("python2-nose" ,python2-nose)
792 ("python2-sphinx" ,python2-sphinx)))
793 (arguments
794 `(#:test-target "check"
795 #:parallel-build? #f ; parallel builds trigger an ICE
796 #:configure-flags
797 (list "-Wno-dev" ; suppress developer mode with lots of warnings
798 (string-append "-DVIGRANUMPY_INSTALL_DIR="
799 (assoc-ref %outputs "out")
800 "/lib/python2.7/site-packages")
801 ;; OpenEXR is not enabled by default.
802 "-DWITH_OPENEXR=1"
803 ;; Fix rounding error on 32-bit machines
804 "-DCMAKE_C_FLAGS=-ffloat-store"
805 ;; The header files of ilmbase are not found when included
806 ;; by the header files of openexr, and an explicit flag
807 ;; needs to be set.
808 (string-append "-DCMAKE_CXX_FLAGS=-I"
809 (assoc-ref %build-inputs "ilmbase")
810 "/include/OpenEXR"
811 " -ffloat-store"))))
812 (synopsis "Computer vision library")
813 (description
814 "VIGRA stands for Vision with Generic Algorithms. It is an image
815 processing and analysis library that puts its main emphasis on customizable
816 algorithms and data structures. It is particularly strong for
817 multi-dimensional image processing.")
818 (license license:expat)
819 (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
820
821 (define-public libwebp
822 (package
823 (name "libwebp")
824 (version "0.6.0")
825 (source
826 (origin
827 (method url-fetch)
828 (uri (string-append
829 "http://downloads.webmproject.org/releases/webp/libwebp-" version
830 ".tar.gz"))
831 (sha256
832 (base32
833 "0h1brwkyxc7lb8lc53aacdks5vc1y9hzngqi41gg7y6l56912a69"))))
834 (build-system gnu-build-system)
835 (inputs
836 `(("freeglut" ,freeglut)
837 ("giflib" ,giflib)
838 ("libjpeg" ,libjpeg)
839 ("libpng" ,libpng)
840 ("libtiff" ,libtiff)))
841 (arguments
842 '(#:configure-flags '("--enable-libwebpmux"
843 "--enable-libwebpdemux"
844 "--enable-libwebpdecoder")))
845 (home-page "https://developers.google.com/speed/webp/")
846 (synopsis "Lossless and lossy image compression")
847 (description
848 "WebP is a new image format that provides lossless and lossy compression
849 for images. WebP lossless images are 26% smaller in size compared to
850 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
851 equivalent SSIM index. WebP supports lossless transparency (also known as
852 alpha channel) with just 22% additional bytes. Transparency is also supported
853 with lossy compression and typically provides 3x smaller file sizes compared
854 to PNG when lossy compression is acceptable for the red/green/blue color
855 channels.")
856 (license license:bsd-3)))
857
858 (define-public libmng
859 (package
860 (name "libmng")
861 (version "2.0.3")
862 (source (origin
863 (method url-fetch)
864 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
865 version "/" name "-" version ".tar.xz"))
866 (sha256
867 (base32
868 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
869 (build-system gnu-build-system)
870 (propagated-inputs
871 ;; These are all in the 'Libs.private' field of libmng.pc.
872 `(("lcms" ,lcms)
873 ("libjpeg" ,libjpeg)
874 ("zlib" ,zlib)))
875 (home-page "http://www.libmng.com/")
876 (synopsis "Library for handling MNG files")
877 (description
878 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
879 (license license:bsd-3)))
880
881 (define-public exiv2
882 (package
883 (name "exiv2")
884 (version "0.26")
885 (source (origin
886 (method url-fetch)
887 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
888 version "-trunk.tar.gz")
889 (string-append "http://www.exiv2.org/exiv2-"
890 version ".tar.gz")
891 (string-append "https://fossies.org/linux/misc/exiv2-"
892 version ".tar.gz")))
893 (sha256
894 (base32
895 "1hsdzlzgkipprqh93yj81mrckl2l7c2mn2i84691pallnjz5qqhc"))))
896 (build-system gnu-build-system)
897 (arguments '(#:tests? #f)) ; no `check' target
898 (propagated-inputs
899 `(("expat" ,expat)
900 ("zlib" ,zlib)))
901 (native-inputs
902 `(("intltool" ,intltool)))
903 (home-page "http://www.exiv2.org/")
904 (synopsis "Library and command-line utility to manage image metadata")
905 (description
906 "Exiv2 is a C++ library and a command line utility to manage image
907 metadata. It provides fast and easy read and write access to the Exif, IPTC
908 and XMP metadata of images in various formats.")
909
910 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
911 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
912 ;; The core is GPLv2+:
913 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
914 (license license:gpl2+)))
915
916 (define-public devil
917 (package
918 (name "devil")
919 (version "1.8.0")
920 (source (origin
921 (method url-fetch)
922 (uri (string-append "http://downloads.sourceforge.net/openil/"
923 "DevIL-" version ".tar.gz"))
924 (sha256
925 (base32
926 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
927 (build-system cmake-build-system)
928 (arguments
929 '(;; XXX: Not supported in the released CMakeLists.txt.
930 ;; Enable this for > 1.8.0.
931 #:tests? #f
932 #:phases
933 (modify-phases %standard-phases
934 (add-before 'configure 'change-directory
935 (lambda _ (chdir "DevIL") #t)))))
936 (native-inputs
937 `(("pkg-config" ,pkg-config)))
938 (inputs
939 `(("lcms" ,lcms)
940 ("libjpeg" ,libjpeg-turbo)
941 ("libmng" ,libmng)
942 ("libpng" ,libpng)
943 ("libtiff" ,libtiff)
944 ("openexr" ,openexr)
945 ("zlib" ,zlib)))
946 (synopsis "Library for manipulating many image formats")
947 (description "Developer's Image Library (DevIL) is a library to develop
948 applications with support for many types of images. DevIL can load, save,
949 convert, manipulate, filter and display a wide variety of image formats.")
950 (home-page "http://openil.sourceforge.net")
951 (license license:lgpl2.1+)))
952
953 (define-public jasper
954 (package
955 (name "jasper")
956 (version "2.0.13")
957 (source (origin
958 (method url-fetch)
959 (uri (string-append "https://github.com/mdadams/jasper/archive/"
960 "version-" version ".tar.gz"))
961 (file-name (string-append name "-" version ".tar.gz"))
962 (sha256
963 (base32
964 "090cyqcvqp4y12nc57gvcbrk3ap1rnnixd4qj90sx0pw3fs1615m"))))
965 (build-system cmake-build-system)
966 (inputs `(("libjpeg" ,libjpeg)))
967 (synopsis "JPEG-2000 library")
968 (description "The JasPer Project is an initiative to provide a reference
969 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
970 ISO/IEC 15444-1).")
971 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
972 (license (license:x11-style "file://LICENSE"))))
973
974 (define-public zimg
975 (package
976 (name "zimg")
977 (version "2.5")
978 (source
979 (origin
980 (method url-fetch)
981 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
982 "release-" version ".tar.gz"))
983 (file-name (string-append name "-" version ".tar.gz"))
984 (sha256
985 (base32
986 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
987 (build-system gnu-build-system)
988 (native-inputs
989 `(("autoconf" ,autoconf)
990 ("automake" ,automake)
991 ("libtool" ,libtool)))
992 (arguments
993 '(#:phases
994 (modify-phases %standard-phases
995 (add-after 'unpack 'autogen
996 (lambda _
997 (zero? (system* "sh" "autogen.sh")))))))
998 (synopsis "Scaling, colorspace conversion, and dithering library")
999 (description "Zimg implements the commonly required image processing basics
1000 of scaling, colorspace conversion, and depth conversion. A simple API enables
1001 conversion between any supported formats to operate with minimal knowledge from
1002 the programmer.")
1003 (home-page "https://github.com/sekrit-twc/zimg")
1004 ;; test/extra/ contains musl-libm,
1005 ;; which is MIT/expat licensed, but only used for tests
1006 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
1007
1008 (define-public perceptualdiff
1009 (package
1010 (name "perceptualdiff")
1011 (version "1.3")
1012 (source
1013 (origin
1014 (method url-fetch)
1015 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
1016 version ".tar.gz"))
1017 (file-name (string-append name "-" version ".tar.gz"))
1018 (sha256
1019 (base32
1020 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
1021 (build-system cmake-build-system)
1022 (inputs `(("freeimage" ,freeimage)))
1023 (arguments
1024 '(#:phases (modify-phases %standard-phases
1025 (add-after 'unpack 'fix-tests
1026 ;; cmake-build-system uses a build/ directory outside
1027 ;; of the source tree, one level higher than expected
1028 (lambda _
1029 (substitute* "test/run_tests.bash"
1030 (("../build") "../../build")))))))
1031 (home-page "https://github.com/myint/perceptualdiff")
1032 (synopsis "Perceptual image comparison utility")
1033 (description "PerceptualDiff visually compares two images to determine
1034 whether they look alike. It uses a computational model of the human visual
1035 system to detect similarities. This allows it too see beyond irrelevant
1036 differences in file encoding, image quality, and other small variations.")
1037 (license license:gpl2+)))
1038
1039 (define-public steghide
1040 (package
1041 (name "steghide")
1042 (version "0.5.1")
1043 (source (origin
1044 (method url-fetch)
1045 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1046 version "/steghide-" version ".tar.bz2"))
1047 (sha256
1048 (base32
1049 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1050 (patches (list (search-patch "steghide-fixes.patch")))))
1051 (build-system gnu-build-system)
1052 (native-inputs
1053 `(("gettext" ,gettext-minimal)
1054 ("libtool" ,libtool)
1055 ("perl" ,perl))) ;for tests
1056 (inputs
1057 `(("libmhash" ,libmhash)
1058 ("libmcrypt" ,libmcrypt)
1059 ("libjpeg" ,libjpeg)
1060 ("zlib" ,zlib)))
1061 (arguments
1062 `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
1063 (home-page "http://steghide.sourceforge.net")
1064 (synopsis "Image and audio steganography")
1065 (description
1066 "Steghide is a steganography program that is able to hide data in various
1067 kinds of image- and audio-files. The color- respectivly sample-frequencies
1068 are not changed thus making the embedding resistant against first-order
1069 statistical tests.")
1070 (license license:gpl2+)))
1071
1072 (define-public stb-image-for-extempore
1073 (let ((revision "1")
1074 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1075 (package
1076 (name "stb-image-for-extempore")
1077 (version (string-append "0-" revision "." (string-take commit 9)))
1078 (source
1079 (origin (method git-fetch)
1080 (uri (git-reference
1081 (url "https://github.com/extemporelang/stb.git")
1082 (commit commit)))
1083 (sha256
1084 (base32
1085 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1086 (file-name (string-append name "-" version "-checkout"))))
1087 (build-system cmake-build-system)
1088 (arguments `(#:tests? #f)) ; no tests included
1089 ;; Extempore refuses to build on architectures other than x86_64
1090 (supported-systems '("x86_64-linux"))
1091 (home-page "https://github.com/extemporelang/stb")
1092 (synopsis "Image library for Extempore")
1093 (description
1094 "This package is a collection of assorted single-file libraries. Of
1095 all included libraries only the image loading and decoding library is
1096 installed as @code{stb_image}.")
1097 (license license:public-domain))))
1098
1099 (define-public optipng
1100 (package
1101 (name "optipng")
1102 (version "0.7.6")
1103 (source
1104 (origin
1105 (method url-fetch)
1106 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1107 version ".tar.gz"))
1108 (sha256
1109 (base32
1110 "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
1111 (build-system gnu-build-system)
1112 (inputs
1113 `(("zlib" ,zlib)))
1114 (arguments
1115 '(#:phases
1116 (modify-phases %standard-phases
1117 ;; configure script does not accept arguments CONFIG_SHELL and SHELL
1118 (replace 'configure
1119 (lambda* (#:key outputs #:allow-other-keys)
1120 (zero? (system* "sh" "configure"
1121 (string-append "--prefix=" (assoc-ref outputs "out")))))))))
1122 (synopsis "Optimizer that recompresses PNG image files to a
1123 smaller size")
1124 (description "OptiPNG is a PNG optimizer that recompresses image
1125 files to a smaller size, without losing any information. This program
1126 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1127 PNG, and performs PNG integrity checks and corrections.")
1128 (home-page "http://optipng.sourceforge.net/")
1129 (license license:zlib)))
1130
1131 (define-public libjpeg-turbo
1132 (package
1133 (name "libjpeg-turbo")
1134 (version "1.5.1")
1135 (source (origin
1136 (method url-fetch)
1137 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1138 name "-" version ".tar.gz"))
1139 (sha256
1140 (base32
1141 "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1"))))
1142 (build-system gnu-build-system)
1143 (native-inputs
1144 `(("nasm" ,nasm)))
1145 (arguments
1146 '(#:test-target "test"
1147 #:phases
1148 (modify-phases %standard-phases
1149 (add-after 'unpack 'set-env-on-MIPS
1150 ;; This is borrowed from Debian's patchset for libjpeg
1151 ;; https://sources.debian.net/data/main/libj/libjpeg-turbo/1:1.5.1-2/debian/patches/0001-Declare-env-on-MIPS-on-first-use-Courtesy-of-Aurelie.patch
1152 (lambda _
1153 (substitute* "simd/jsimd_mips.c"
1154 (("env = getenv\\(\"JSIMD_FORCEDSPR2")
1155 "char *env = getenv(\"JSIMD_FORCEDSPR2"))
1156 #t)))))
1157 (home-page "http://www.libjpeg-turbo.org/")
1158 (synopsis "SIMD-accelerated JPEG image handling library")
1159 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1160 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1161 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1162 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1163 a significant amount.
1164 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1165 but more straightforward TurboJPEG API, and provides a full-featured Java
1166 interface. It supports color space extensions that allow it to compress from
1167 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1168 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1169 license:ijg)))) ; the rest
1170
1171 (define-public niftilib
1172 (package
1173 (name "niftilib")
1174 (version "2.0.0")
1175 (source (origin
1176 (method url-fetch)
1177 (uri (list (string-append "mirror://sourceforge/niftilib/"
1178 "nifticlib/nifticlib_"
1179 (string-join (string-split version #\.) "_")
1180 "/nifticlib-" version ".tar.gz")))
1181 (sha256
1182 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1183 (build-system gnu-build-system)
1184 (arguments
1185 '(#:tests? #f ; there is no test target
1186 #:parallel-build? #f ; not supported
1187 #:make-flags
1188 (list "SHELL=bash"
1189 (string-append "ZLIB_INC="
1190 (assoc-ref %build-inputs "zlib") "/include")
1191 ;; Append "-fPIC" to CFLAGS.
1192 (string-append "CFLAGS="
1193 "-Wall -ansi -pedantic -fPIC"))
1194 #:phases
1195 (modify-phases %standard-phases
1196 (replace 'install
1197 (lambda* (#:key outputs #:allow-other-keys)
1198 (let ((out (assoc-ref outputs "out")))
1199 (for-each
1200 (lambda (dir)
1201 (copy-recursively dir (string-append out "/" dir)))
1202 '("bin" "lib" "include")))
1203 #t))
1204 (delete 'configure))))
1205 (inputs
1206 `(("zlib" ,zlib)))
1207 (synopsis "Library for reading and writing files in the nifti-1 format")
1208 (description "Niftilib is a set of i/o libraries for reading and writing
1209 files in the nifti-1 data format - a binary file format for storing
1210 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1211 (fMRI) brain images.")
1212 (home-page "http://niftilib.sourceforge.net")
1213 (license license:public-domain)))