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>
20 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
73 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
74 version "/libpng-" version ".tar.xz")
76 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
77 "/libpng16/libpng-" version ".tar.xz")
79 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
80 "/libpng16/libpng-" version ".tar.xz")))
82 (base32 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
83 (build-system gnu-build-system)
85 ;; libpng.la says "-lz", so propagate it.
86 (propagated-inputs `(("zlib" ,zlib)))
88 (synopsis "Library for handling PNG files")
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")))
95 (define-public libpng-apng
98 (replacement #f) ;libpng's replacement doesn't apply here
100 (version (package-version libpng))
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"
109 (let ((apng.gz (assoc-ref inputs "apng")))
110 (format #t "Applying APNG patch '~a'...~%"
112 (system (string-append "gunzip < " apng.gz " > the-patch"))
113 (and (apply-patch "the-patch")
114 (for-each apply-patch
115 (find-files "\\.patch"))))
117 (add-before 'configure 'no-checks
119 (substitute* "Makefile.in"
120 (("^scripts/symbols.chk") "")
121 (("check: scripts/symbols.chk") ""))
127 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
128 version "/libpng-" version "-apng.patch.gz"))
131 "026r0gbkf6d6v54wca02cdxln8sj4m2c1yk62sj2aasv2ki2ffh5"))))))
133 `(("libtool" ,libtool)))
134 (synopsis "APNG patch for libpng")
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/")))
141 (define-public libpng-1.2
148 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
149 version "/libpng-" version ".tar.xz")
151 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
152 "/libpng12/libpng-" version ".tar.xz")
154 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
155 "/libpng12/libpng-" version ".tar.xz")))
157 (base32 "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg"))))))
159 (define-public pngcrunch
165 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
166 version "/pngcrush-" version ".tar.xz"))
168 "1c7m316i91jp3h1dj1ppppdv6zilm2njk1wrpqy2zj0fcll06lwd"))))
169 (build-system gnu-build-system)
171 '(#:make-flags '("-f" "Makefile-nolib")
172 #:tests? #f ; no check target
174 (modify-phases %standard-phases
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") "/"))))))))
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)))
194 (define-public libjpeg
200 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
203 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
204 (build-system gnu-build-system)
205 (synopsis "Library for handling JPEG files")
207 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
208 JPEG is a standardized compression method for full-color and gray-scale
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/")))
215 (define-public libjpeg-8
216 (package (inherit libjpeg)
220 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
223 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
225 (define-public libjxr
230 ;; We are using the Debian source because CodePlex does not
231 ;; deliver an easily downloadable tarball.
233 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
234 version ".orig.tar.gz"))
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
245 (modify-phases %standard-phases
246 (delete 'configure) ; no configure script
247 ;; The upstream makefile does not include an install phase.
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)
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)
266 (find-files "." "\\.a$"))
267 (for-each (lambda (file)
268 (install-file file bin)
270 '("JxrDecApp" "JxrEncApp")))
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.")
276 (license:non-copyleft
278 "See the header of the Makefile in the distribution."))
279 (home-page "https://jxrlib.codeplex.com/")))
281 (define-public jpegoptim
287 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
290 "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
291 (build-system gnu-build-system)
292 (inputs `(("libjpeg" ,libjpeg)))
296 (synopsis "Optimize JPEG images")
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")))
304 (define-public libicns
311 "mirror://sourceforge/icns/"
312 "libicns-" version ".tar.gz"))
315 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
316 (build-system gnu-build-system)
321 `(#:tests? #t)) ; No tests.
322 (home-page "http://icns.sourceforge.net/")
323 (synopsis "Library for handling Mac OS icns resource files")
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
335 (define-public libtiff
338 (replacement libtiff-4.0.8)
342 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
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"))
362 "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz"))))
363 (build-system gnu-build-system)
365 "doc")) ;1.3 MiB of HTML documentation
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")
371 ,name "-" ,version))))
372 ;; Build with a patched GCC to work around <http://bugs.gnu.org/24703>.
375 (inputs `(("zlib" ,zlib)
376 ("libjpeg" ,libjpeg)))
377 (synopsis "Library for handling TIFF files")
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/")))
387 (define libtiff-4.0.8
394 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
398 "0419mh6kkhz5fkyl77gv0in8x4d2jpdpfs147y8mj86rrjlabmsr"))))))
400 (define-public libwmf
407 (uri (string-append "mirror://sourceforge/wvware/"
409 "/" name "-" version ".tar.gz"))
411 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
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"))))
426 (build-system gnu-build-system)
428 `(("freetype" ,freetype)
434 `(("pkg-config" ,pkg-config)))
435 (synopsis "Library for reading images in the Microsoft WMF format")
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")
443 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
444 (license license:lgpl2.0+)))
446 (define-public leptonica
454 "https://github.com/DanBloomberg/leptonica/archive/" version
456 (file-name (string-append "leptonica-" version ".tar.gz"))
458 (base32 "0i2a4vx9gizki0wgmv03xjz8j9d8agkvbag1a8m4kcw4asd4p87g"))))
459 (build-system gnu-build-system)
461 `(("gnuplot" ,gnuplot) ;needed for test suite
462 ("autoconf" ,autoconf)
463 ("automake" ,automake)
465 ("pkg-config" ,pkg-config)))
471 ("libwebp" ,libwebp)))
473 ;; Linking a program with leptonica also requires these.
474 `(("openjpeg" ,openjpeg)
478 (modify-phases %standard-phases
479 (add-after 'unpack 'autogen
481 (zero? (system* "sh" "autobuild"))))
482 (add-after 'unpack 'patch-reg-wrapper
484 (substitute* "prog/reg_wrapper.sh"
486 (string-append " " (which "sh") " "))
489 (home-page "http://www.leptonica.com/")
490 (synopsis "Library and tools for image processing and analysis")
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
498 (license license:bsd-2)))
500 (define-public jbig2dec
507 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
508 name "-" version ".tar.gz"))
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"))))
517 (build-system gnu-build-system)
518 (synopsis "Decoder of the JBIG2 image compression format")
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.
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
529 (home-page "http://www.ghostscript.com/jbig2dec.html")
530 (license license:gpl2+)))
532 (define-public openjpeg
540 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
542 (file-name (string-append name "-" version ".tar.gz"))
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)
550 ;; Trying to run `$ make check' results in a no rule fault.
557 (synopsis "JPEG 2000 codec")
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
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)))
571 (define-public openjpeg-1
572 (package (inherit openjpeg)
579 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
580 name "-" version ".tar.gz"))
582 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
584 (define-public giflib
590 (uri (string-append "mirror://sourceforge/giflib/giflib-"
594 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
595 (build-system gnu-build-system)
596 (outputs '("bin" ; utility programs
598 (inputs `(("libx11" ,libx11)
604 (modify-phases %standard-phases
605 (add-after 'unpack 'disable-html-doc-gen
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")))
614 (for-each (lambda (file)
615 (let ((base (basename file)))
616 (format #t "installing `~a' to `~a'~%"
621 (find-files "doc" "\\.1"))))))))
622 (synopsis "Tools and library for working with GIF images")
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)))
631 (define-public libungif
637 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
638 "libungif-" version "/libungif-"
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")
648 "libungif is the old GIF decompression library by the GIFLIB project.")
649 (license license:expat)))
651 (define-public imlib2
658 "mirror://sourceforge/enlightenment/imlib2-src/" version
659 "/imlib2-" version ".tar.bz2"))
662 "0wm2q2xlkbm71k7mw2jyzbxgzylrkcj5yh6nq58w5gybhp98qs9z"))))
663 (build-system gnu-build-system)
665 `(("pkgconfig" ,pkg-config)))
669 ("freetype" ,freetype)
675 (home-page "https://sourceforge.net/projects/enlightenment/")
677 "Loading, saving, rendering and manipulating image files")
679 "Imlib2 is a library that does image file loading and saving as well as
680 rendering, manipulation, arbitrary polygon support, etc.
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.
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)))
690 (define-public giblib
698 "http://linuxbrit.co.uk/downloads/giblib-"
701 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
702 "files/giblib/giblib-" version ".tar.gz")))
705 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
706 (build-system gnu-build-system)
710 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
711 (synopsis "Wrapper library for imlib2")
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
718 (license (license:x11-style "file://COPYING"
719 "See 'COPYING' in the distribution."))))
721 (define-public freeimage
728 "mirror://sourceforge/freeimage/Source%20Distribution/"
730 (string-concatenate (string-split version #\.))
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)
741 (modify-phases %standard-phases
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") ""))
749 #:make-flags '("CC=gcc")
750 #:tests? #f)) ; no check target
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")
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")))
769 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
770 "Version-1-11-0/vigra-"
771 version "-src.tar.gz"))
773 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
774 (build-system cmake-build-system)
780 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
781 ; to create a configure-flag
786 ("python" ,python-2) ; print syntax
787 ("python2-numpy" ,python2-numpy)
790 `(("doxygen" ,doxygen)
791 ("python2-nose" ,python2-nose)
792 ("python2-sphinx" ,python2-sphinx)))
794 `(#:test-target "check"
795 #:parallel-build? #f ; parallel builds trigger an ICE
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.
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
808 (string-append "-DCMAKE_CXX_FLAGS=-I"
809 (assoc-ref %build-inputs "ilmbase")
812 (synopsis "Computer vision library")
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")))
821 (define-public libwebp
829 "http://downloads.webmproject.org/releases/webp/libwebp-" version
833 "0h1brwkyxc7lb8lc53aacdks5vc1y9hzngqi41gg7y6l56912a69"))))
834 (build-system gnu-build-system)
836 `(("freeglut" ,freeglut)
840 ("libtiff" ,libtiff)))
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")
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
856 (license license:bsd-3)))
858 (define-public libmng
864 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
865 version "/" name "-" version ".tar.xz"))
868 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
869 (build-system gnu-build-system)
871 ;; These are all in the 'Libs.private' field of libmng.pc.
875 (home-page "http://www.libmng.com/")
876 (synopsis "Library for handling MNG files")
878 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
879 (license license:bsd-3)))
887 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
888 version "-trunk.tar.gz")
889 (string-append "http://www.exiv2.org/exiv2-"
891 (string-append "https://fossies.org/linux/misc/exiv2-"
895 "1hsdzlzgkipprqh93yj81mrckl2l7c2mn2i84691pallnjz5qqhc"))))
896 (build-system gnu-build-system)
897 (arguments '(#:tests? #f)) ; no `check' target
902 `(("intltool" ,intltool)))
903 (home-page "http://www.exiv2.org/")
904 (synopsis "Library and command-line utility to manage image metadata")
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.")
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+)))
922 (uri (string-append "http://downloads.sourceforge.net/openil/"
923 "DevIL-" version ".tar.gz"))
926 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
927 (build-system cmake-build-system)
929 '(;; XXX: Not supported in the released CMakeLists.txt.
930 ;; Enable this for > 1.8.0.
933 (modify-phases %standard-phases
934 (add-before 'configure 'change-directory
935 (lambda _ (chdir "DevIL") #t)))))
937 `(("pkg-config" ,pkg-config)))
940 ("libjpeg" ,libjpeg-turbo)
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+)))
953 (define-public jasper
959 (uri (string-append "https://github.com/mdadams/jasper/archive/"
960 "version-" version ".tar.gz"))
961 (file-name (string-append name "-" version ".tar.gz"))
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.,
971 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
972 (license (license:x11-style "file://LICENSE"))))
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"))
986 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
987 (build-system gnu-build-system)
989 `(("autoconf" ,autoconf)
990 ("automake" ,automake)
991 ("libtool" ,libtool)))
994 (modify-phases %standard-phases
995 (add-after 'unpack 'autogen
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
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
1008 (define-public perceptualdiff
1010 (name "perceptualdiff")
1015 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
1017 (file-name (string-append name "-" version ".tar.gz"))
1020 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
1021 (build-system cmake-build-system)
1022 (inputs `(("freeimage" ,freeimage)))
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
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+)))
1039 (define-public steghide
1045 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1046 version "/steghide-" version ".tar.bz2"))
1049 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1050 (patches (list (search-patch "steghide-fixes.patch")))))
1051 (build-system gnu-build-system)
1053 `(("gettext" ,gettext-minimal)
1054 ("libtool" ,libtool)
1055 ("perl" ,perl))) ;for tests
1057 `(("libmhash" ,libmhash)
1058 ("libmcrypt" ,libmcrypt)
1059 ("libjpeg" ,libjpeg)
1062 `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
1063 (home-page "http://steghide.sourceforge.net")
1064 (synopsis "Image and audio steganography")
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+)))
1072 (define-public stb-image-for-extempore
1073 (let ((revision "1")
1074 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1076 (name "stb-image-for-extempore")
1077 (version (string-append "0-" revision "." (string-take commit 9)))
1079 (origin (method git-fetch)
1081 (url "https://github.com/extemporelang/stb.git")
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")
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))))
1099 (define-public optipng
1106 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1110 "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
1111 (build-system gnu-build-system)
1116 (modify-phases %standard-phases
1117 ;; configure script does not accept arguments CONFIG_SHELL and SHELL
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
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)))
1131 (define-public libjpeg-turbo
1133 (name "libjpeg-turbo")
1137 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1138 name "-" version ".tar.gz"))
1141 "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1"))))
1142 (build-system gnu-build-system)
1146 '(#:test-target "test"
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
1153 (substitute* "simd/jsimd_mips.c"
1154 (("env = getenv\\(\"JSIMD_FORCEDSPR2")
1155 "char *env = getenv(\"JSIMD_FORCEDSPR2"))
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
1171 (define-public niftilib
1177 (uri (list (string-append "mirror://sourceforge/niftilib/"
1178 "nifticlib/nifticlib_"
1179 (string-join (string-split version #\.) "_")
1180 "/nifticlib-" version ".tar.gz")))
1182 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1183 (build-system gnu-build-system)
1185 '(#:tests? #f ; there is no test target
1186 #:parallel-build? #f ; not supported
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"))
1195 (modify-phases %standard-phases
1197 (lambda* (#:key outputs #:allow-other-keys)
1198 (let ((out (assoc-ref outputs "out")))
1201 (copy-recursively dir (string-append out "/" dir)))
1202 '("bin" "lib" "include")))
1204 (delete 'configure))))
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)))