gnu: Add steghide.
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
5 ;;; Copyright © 2014, 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
7 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
8 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
9 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages image)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages boost)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages documentation)
36 #:use-module (gnu packages fontutils)
37 #:use-module (gnu packages gettext)
38 #:use-module (gnu packages ghostscript)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages graphics)
41 #:use-module (gnu packages maths)
42 #:use-module (gnu packages mcrypt)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages xml)
47 #:use-module (gnu packages xorg)
48 #:use-module (gnu packages zip)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix build-system gnu)
53 #:use-module (guix build-system cmake)
54 #:use-module (srfi srfi-1))
55
56 (define-public libpng
57 (package
58 (name "libpng")
59 (version "1.5.26")
60 (source (origin
61 (method url-fetch)
62
63 ;; Note: upstream removes older tarballs.
64 (uri (list (string-append "mirror://sourceforge/libpng/libpng15/"
65 version "/libpng-" version ".tar.xz")
66 (string-append
67 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
68 "/libpng15/libpng-" version ".tar.xz")))
69 (sha256
70 (base32 "0kbissyd7d4ahwdpm968nnzl7q15p6hadg44i9x0vrkrzdgdi93v"))))
71 (build-system gnu-build-system)
72
73 ;; libpng.la says "-lz", so propagate it.
74 (propagated-inputs `(("zlib" ,zlib)))
75
76 (synopsis "Library for handling PNG files")
77 (description
78 "Libpng is the official PNG (Portable Network Graphics) reference
79 library. It supports almost all PNG features and is extensible.")
80 (license license:zlib)
81 (home-page "http://www.libpng.org/pub/png/libpng.html")))
82
83 (define-public libpng-1.2
84 (package
85 (inherit libpng)
86 (version "1.2.56")
87 (source
88 (origin
89 (method url-fetch)
90 ;; Note: upstream removes older tarballs.
91 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
92 version "/libpng-" version ".tar.xz")
93 (string-append
94 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
95 "/libpng12/libpng-" version ".tar.xz")))
96 (sha256
97 (base32 "1ghd03p353x0vi4dk83n1nlldg11w7vqdk3f99rkgfb82ic59ki4"))))))
98
99 (define-public libjpeg
100 (package
101 (name "libjpeg")
102 (version "9a")
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
106 version ".tar.gz"))
107 (sha256 (base32
108 "19q5zr4n60sjcvfbyv06n4pcl1mai3ipvnd2akflayciinj3wx9s"))))
109 (build-system gnu-build-system)
110 (synopsis "Library for handling JPEG files")
111 (description
112 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
113 JPEG is a standardized compression method for full-color and gray-scale
114 images.
115 The included programs provide conversion between the JPEG format and
116 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
117 (license license:ijg)
118 (home-page "http://www.ijg.org/")))
119
120 (define-public libjpeg-8
121 (package (inherit libjpeg)
122 (version "8d")
123 (source (origin
124 (method url-fetch)
125 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
126 version ".tar.gz"))
127 (sha256 (base32
128 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
129
130 (define-public jpegoptim
131 (package
132 (name "jpegoptim")
133 (version "1.4.3")
134 (source (origin
135 (method url-fetch)
136 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
137 version ".tar.gz"))
138 (sha256 (base32
139 "0k53q7dc8w5ashz8v261x2b5vvz7gdvg8w962rz9gjvkjbh4lg93"))))
140 (build-system gnu-build-system)
141 (inputs `(("libjpeg" ,libjpeg)))
142 (arguments
143 ;; no tests
144 '(#:tests? #f))
145 (synopsis "Optimize JPEG images")
146 (description
147 "jpegoptim provides lossless optimization (based on optimizing
148 the Huffman tables) and \"lossy\" optimization based on setting
149 maximum quality factor.")
150 (license license:gpl2+)
151 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
152
153 (define-public libicns
154 (package
155 (name "libicns")
156 (version "0.8.1")
157 (source (origin
158 (method url-fetch)
159 (uri (string-append
160 "mirror://sourceforge/icns/"
161 "libicns-" version ".tar.gz"))
162 (sha256
163 (base32
164 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
165 (build-system gnu-build-system)
166 (inputs
167 `(("libpng" ,libpng)
168 ("jasper" ,jasper)))
169 (arguments
170 `(#:tests? #t)) ; No tests.
171 (home-page "http://icns.sourceforge.net/")
172 (synopsis "Library for handling Mac OS icns resource files")
173 (description
174 "Libicns is a library for the manipulation of Mac OS IconFamily resource
175 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
176 convert between PNG and ICNS. @command{icns2png} will extract image files from
177 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
178 with .desktop files. Additionally, @command{icontainer2png} is provided for
179 extracting icontainer icon files.")
180 (license (list license:lgpl2.1+ ; libicns
181 license:lgpl2.0+ ; src/apidocs.*
182 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
183
184 (define-public libtiff
185 (package
186 (name "libtiff")
187 (replacement libtiff/fixed)
188 (version "4.0.6")
189 (source (origin
190 (method url-fetch)
191 (uri (string-append "ftp://ftp.remotesensing.org/pub/libtiff/tiff-"
192 version ".tar.gz"))
193 (sha256 (base32
194 "136nf1rj9dp5jgv1p7z4dk0xy3wki1w0vfjbk82f645m0w4samsd"))
195 (patches (search-patches
196 "libtiff-oob-accesses-in-decode.patch"
197 "libtiff-oob-write-in-nextdecode.patch"
198 "libtiff-CVE-2015-8665+CVE-2015-8683.patch"))))
199 (build-system gnu-build-system)
200 (outputs '("out"
201 "doc")) ;1.3 MiB of HTML documentation
202 (arguments
203 ;; Instead of using --docdir, this package has its own --with-docdir.
204 `(#:configure-flags (list (string-append "--with-docdir="
205 (assoc-ref %outputs "doc")
206 "/share/doc/"
207 ,name "-" ,version))))
208 (inputs `(("zlib" ,zlib)
209 ("libjpeg" ,libjpeg)))
210 (synopsis "Library for handling TIFF files")
211 (description
212 "Libtiff provides support for the Tag Image File Format (TIFF), a format
213 used for storing image data.
214 Included are a library, libtiff, for reading and writing TIFF and a small
215 collection of tools for doing simple manipulations of TIFF images.")
216 (license (license:non-copyleft "file://COPYRIGHT"
217 "See COPYRIGHT in the distribution."))
218 (home-page "http://www.remotesensing.org/libtiff/")))
219
220 (define libtiff/fixed
221 (package
222 (inherit libtiff)
223 (source (origin
224 (inherit (package-source libtiff))
225 (patches (search-patches
226 "libtiff-oob-accesses-in-decode.patch"
227 "libtiff-oob-write-in-nextdecode.patch"
228 "libtiff-CVE-2015-8665+CVE-2015-8683.patch"
229 "libtiff-CVE-2016-3623.patch"
230 "libtiff-CVE-2016-3945.patch"
231 "libtiff-CVE-2016-3990.patch"
232 "libtiff-CVE-2016-3991.patch"
233 "libtiff-CVE-2016-5314.patch"
234 "libtiff-CVE-2016-5321.patch"
235 "libtiff-CVE-2016-5323.patch"))))))
236
237 (define-public libwmf
238 (package
239 (name "libwmf")
240 (version "0.2.8.4")
241 (source
242 (origin
243 (method url-fetch)
244 (uri (string-append "mirror://sourceforge/wvware/"
245 name "/" version
246 "/" name "-" version ".tar.gz"))
247 (sha256
248 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
249 (patches
250 (search-patches "libwmf-CAN-2004-0941.patch"
251 "libwmf-CVE-2006-3376.patch"
252 "libwmf-CVE-2007-0455.patch"
253 "libwmf-CVE-2007-2756.patch"
254 "libwmf-CVE-2007-3472.patch"
255 "libwmf-CVE-2007-3473.patch"
256 "libwmf-CVE-2007-3477.patch"
257 "libwmf-CVE-2009-1364.patch"
258 "libwmf-CVE-2009-3546.patch"
259 "libwmf-CVE-2015-0848+CVE-2015-4588.patch"
260 "libwmf-CVE-2015-4695.patch"
261 "libwmf-CVE-2015-4696.patch"))))
262
263 (build-system gnu-build-system)
264 (inputs
265 `(("freetype" ,freetype)
266 ("libjpeg" ,libjpeg)
267 ("libpng",libpng)
268 ("libxml2" ,libxml2)
269 ("zlib" ,zlib)))
270 (native-inputs
271 `(("pkg-config" ,pkg-config)))
272 (synopsis "Library for reading images in the Microsoft WMF format")
273 (description
274 "libwmf is a library for reading vector images in Microsoft's native
275 Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
276 window; or (b) converting them to more standard/free file formats such as, e.g.,
277 the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
278 (home-page "http://wvware.sourceforge.net/libwmf.html")
279
280 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
281 (license license:lgpl2.0+)))
282
283 (define-public leptonica
284 (package
285 (name "leptonica")
286 (version "1.72")
287 (source
288 (origin
289 (method url-fetch)
290 (uri (string-append "http://www.leptonica.com/source/leptonica-"
291 version ".tar.gz"))
292 (sha256
293 (base32 "0mhzvqs0im04y1cpcc1yma70hgdac1frf33h73m9z3356bfymmbr"))
294 (modules '((guix build utils)))
295 ;; zlib and openjpg should be under Libs, not Libs.private. See:
296 ;; https://code.google.com/p/tesseract-ocr/issues/detail?id=1436
297 (snippet
298 '(substitute* "lept.pc.in"
299 (("^(Libs\\.private: .*)@ZLIB_LIBS@(.*)" all pre post)
300 (string-append pre post))
301 (("^(Libs\\.private: .*)@JPEG_LIBS@(.*)" all pre post)
302 (string-append pre post))
303 (("^Libs: .*" all)
304 (string-append all " @ZLIB_LIBS@ @JPEG_LIBS@"))))))
305 (build-system gnu-build-system)
306 (native-inputs
307 `(("gnuplot" ,gnuplot))) ;needed for test suite
308 (inputs
309 `(("giflib" ,giflib)
310 ("libjpeg" ,libjpeg)
311 ("libpng" ,libpng)
312 ("libtiff" ,libtiff)
313 ("libwebp" ,libwebp)))
314 (propagated-inputs
315 `(("openjpeg" ,openjpeg)
316 ("zlib" ,zlib)))
317 (arguments
318 '(#:parallel-tests? #f ; XXX: cause fpix1_reg to fail
319 #:phases
320 (modify-phases %standard-phases
321 ;; Prevent make from trying to regenerate config.h.in.
322 (add-after
323 'unpack 'set-config-h-in-file-time
324 (lambda _
325 (set-file-time "config/config.h.in" (stat "configure"))))
326 (add-after
327 'unpack 'patch-reg-wrapper
328 (lambda _
329 (substitute* "prog/reg_wrapper.sh"
330 ((" /bin/sh ")
331 (string-append " " (which "sh") " "))
332 (("which gnuplot") (which "gnuplot")))))
333 (add-before
334 'check 'disable-failing-tests
335 ;; XXX: 2 of 9 tests from webpio_reg fails.
336 (lambda _
337 (substitute* "prog/webpio_reg.c"
338 ((".*DoWebpTest2.* 90.*") "")
339 ((".*DoWebpTest2.* 100.*") "")))))))
340 (home-page "http://www.leptonica.com/")
341 (synopsis "Library and tools for image processing and analysis")
342 (description
343 "Leptonica is a C library and set of command-line tools for efficient
344 image processing and image analysis operations. It supports rasterop, affine
345 transformations, binary and grayscale morphology, rank order, and convolution,
346 seedfill and connected components, image transformations combining changes in
347 scale and pixel depth, and pixelwise masking, blending, enhancement, and
348 arithmetic ops.")
349 (license license:bsd-2)))
350
351 (define-public jbig2dec
352 (package
353 (name "jbig2dec")
354 (version "0.11")
355 (source
356 (origin
357 (method url-fetch)
358 (uri ;; The link on the homepage is dead.
359 (string-append "http://distfiles.gentoo.org/distfiles/" name "-"
360 version ".tar.gz"))
361 (sha256
362 (base32 "1ffhgmf2fqzk0h4k736pp06z7q5y4x41fg844bd6a9vgncq86bby"))
363 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
364
365 (build-system gnu-build-system)
366 (synopsis "Decoder of the JBIG2 image compression format")
367 (description
368 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
369 monochrome) images at moderately high resolution, and in particular scanned
370 paper documents. In this domain it is very efficient, offering compression
371 ratios on the order of 100:1.
372
373 This is a decoder only implementation, and currently is in the alpha
374 stage, meaning it doesn't completely work yet. However, it is
375 maintaining parity with available encoders, so it is useful for real
376 work.")
377 (home-page "http://jbig2dec.sourceforge.net/")
378 (license license:gpl2+)))
379
380 (define-public openjpeg
381 (package
382 (name "openjpeg")
383 (version "2.1.0")
384 (source
385 (origin
386 (method url-fetch)
387 (uri
388 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
389 name "-" version ".tar.gz"))
390 (sha256
391 (base32 "00zzm303zvv4ijzancrsb1cqbph3pgz0nky92k9qx3fq9y0vnchj"))
392 (patches (search-patches "openjpeg-use-after-free-fix.patch"
393 "openjpeg-CVE-2015-6581.patch"))))
394 (build-system cmake-build-system)
395 (arguments
396 ;; Trying to run `$ make check' results in a no rule fault.
397 '(#:tests? #f))
398 (inputs
399 `(("lcms" ,lcms)
400 ("libpng" ,libpng)
401 ("libtiff" ,libtiff)
402 ("zlib" ,zlib)))
403 (synopsis "JPEG 2000 codec")
404 (description
405 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
406 been developed in order to promote the use of JPEG 2000, the new
407 still-image compression standard from the Joint Photographic Experts
408 Group (JPEG).
409
410 In addition to the basic codec, various other features are under
411 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
412 an indexing tool useful for the JPIP protocol, JPWL-tools for
413 error-resilience, a Java-viewer for j2k-images, ...")
414 (home-page "https://github.com/uclouvain/openjpeg")
415 (license license:bsd-2)))
416
417 (define-public openjpeg-2.0
418 (package (inherit openjpeg)
419 (name "openjpeg")
420 (version "2.0.1")
421 (source
422 (origin
423 (method url-fetch)
424 (uri
425 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
426 name "-" version ".tar.gz"))
427 (sha256
428 (base32 "1c2xc3nl2mg511b63rk7hrckmy14681p1m44mzw3n1fyqnjm0b0z"))
429 (patches (search-patches "openjpeg-use-after-free-fix.patch"
430 "openjpeg-CVE-2015-6581.patch"))))))
431
432 (define-public openjpeg-1
433 (package (inherit openjpeg)
434 (name "openjpeg")
435 (version "1.5.2")
436 (source
437 (origin
438 (method url-fetch)
439 (uri
440 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
441 name "-" version ".tar.gz"))
442 (sha256
443 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
444
445 (define-public giflib
446 (package
447 (name "giflib")
448 (version "5.1.4")
449 (source (origin
450 (method url-fetch)
451 (uri (string-append "mirror://sourceforge/giflib/giflib-"
452 version ".tar.bz2"))
453 (sha256
454 (base32
455 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
456 (build-system gnu-build-system)
457 (outputs '("bin" ; utility programs
458 "out")) ; library
459 (inputs `(("libx11" ,libx11)
460 ("libice" ,libice)
461 ("libsm" ,libsm)
462 ("perl" ,perl)))
463 (arguments
464 `(#:phases
465 (modify-phases %standard-phases
466 (add-after 'unpack 'disable-html-doc-gen
467 (lambda _
468 (substitute* "doc/Makefile.in"
469 (("^all: allhtml manpages") ""))))
470 (add-after 'install 'install-manpages
471 (lambda* (#:key outputs #:allow-other-keys)
472 (let* ((bin (assoc-ref outputs "bin"))
473 (man1dir (string-append bin "/share/man/man1")))
474 (mkdir-p man1dir)
475 (for-each (lambda (file)
476 (let ((base (basename file)))
477 (format #t "installing `~a' to `~a'~%"
478 base man1dir)
479 (copy-file file
480 (string-append
481 man1dir "/" base))))
482 (find-files "doc" "\\.1"))))))))
483 (synopsis "Tools and library for working with GIF images")
484 (description
485 "GIFLIB is a library for reading and writing GIF images. It is API and
486 ABI compatible with libungif which was in wide use while the LZW compression
487 algorithm was patented. Tools are also included to convert, manipulate,
488 compose, and analyze GIF images.")
489 (home-page "http://giflib.sourceforge.net/")
490 (license license:x11)))
491
492 (define-public libungif
493 (package
494 (name "libungif")
495 (version "4.1.4")
496 (source (origin
497 (method url-fetch)
498 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
499 "libungif-" version "/libungif-"
500 version ".tar.bz2"))
501 (sha256
502 (base32
503 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
504 (build-system gnu-build-system)
505 (inputs `(("perl" ,perl))) ;package ships some perl tools
506 (home-page "http://giflib.sourceforge.net/")
507 (synopsis "GIF decompression library")
508 (description
509 "libungif is the old GIF decompression library by the GIFLIB project.")
510 (license license:expat)))
511
512 (define-public imlib2
513 (package
514 (name "imlib2")
515 (version "1.4.9")
516 (source (origin
517 (method url-fetch)
518 (uri (string-append
519 "mirror://sourceforge/enlightenment/imlib2-src/" version
520 "/imlib2-" version ".tar.bz2"))
521 (sha256
522 (base32
523 "08809xxk2555yj6glixzw9a0x3x8cx55imd89kj3r0h152bn8a3x"))))
524 (build-system gnu-build-system)
525 (native-inputs
526 `(("pkgconfig" ,pkg-config)))
527 (inputs
528 `(("libx11" ,libx11)
529 ("libxext" ,libxext)
530 ("freetype" ,freetype)
531 ("libjpeg" ,libjpeg)
532 ("libpng" ,libpng)
533 ("libtiff" ,libtiff)
534 ("giflib" ,giflib)
535 ("bzip2" ,bzip2)))
536 (home-page "http://sourceforge.net/projects/enlightenment/")
537 (synopsis
538 "Loading, saving, rendering and manipulating image files")
539 (description
540 "Imlib2 is a library that does image file loading and saving as well as
541 rendering, manipulation, arbitrary polygon support, etc.
542
543 It does ALL of these operations FAST. Imlib2 also tries to be highly
544 intelligent about doing them, so writing naive programs can be done easily,
545 without sacrificing speed.
546
547 This is a complete rewrite over the Imlib 1.x series. The architecture is
548 more modular, simple, and flexible.")
549 (license license:imlib2)))
550
551 (define-public giblib
552 (package
553 (name "giblib")
554 (version "1.2.4")
555 (source (origin
556 (method url-fetch)
557 (uri (list
558 (string-append
559 "http://linuxbrit.co.uk/downloads/giblib-"
560 version ".tar.gz")
561 (string-append
562 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
563 "files/giblib/giblib-" version ".tar.gz")))
564 (sha256
565 (base32
566 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
567 (build-system gnu-build-system)
568 (inputs
569 `(("libx11" ,libx11)
570 ("imlib2" ,imlib2)))
571 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
572 (synopsis "Wrapper library for imlib2")
573 (description
574 "Giblib is a simple library which wraps imlib2's context API, avoiding
575 all the context_get/set calls, adds fontstyles to the truetype renderer and
576 supplies a generic doubly-linked list and some string functions.")
577 ;; This license removes a clause about X Consortium from the original
578 ;; X11 license.
579 (license (license:x11-style "file://COPYING"
580 "See 'COPYING' in the distribution."))))
581
582 (define-public freeimage
583 (package
584 (name "freeimage")
585 (version "3.17.0")
586 (source (origin
587 (method url-fetch)
588 (uri (string-append
589 "mirror://sourceforge/freeimage/Source%20Distribution/"
590 version "/FreeImage"
591 (string-concatenate (string-split version #\.))
592 ".zip"))
593 (sha256
594 (base32
595 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
596 (patches (search-patches "freeimage-CVE-2015-0852.patch"))))
597 (build-system gnu-build-system)
598 (arguments
599 '(#:phases (alist-delete
600 'configure
601 (alist-cons-before
602 'build 'patch-makefile
603 (lambda* (#:key outputs #:allow-other-keys)
604 (substitute* "Makefile.gnu"
605 (("/usr") (assoc-ref outputs "out"))
606 (("-o root -g root") "")))
607 %standard-phases))
608 #:make-flags '("CC=gcc")
609 #:tests? #f)) ; no check target
610 (native-inputs
611 `(("unzip" ,unzip)))
612 ;; Fails to build on MIPS due to assembly code in the source.
613 (supported-systems (delete "mips64el-linux" %supported-systems))
614 (synopsis "Library for handling popular graphics image formats")
615 (description
616 "FreeImage is a library for developers who would like to support popular
617 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
618 (license license:gpl2+)
619 (home-page "http://freeimage.sourceforge.net")))
620
621 (define-public vigra
622 (package
623 (name "vigra")
624 (version "1.11.0")
625 (source
626 (origin
627 (method url-fetch)
628 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
629 "Version-1-11-0/vigra-"
630 version "-src.tar.gz"))
631 (sha256 (base32
632 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
633 (build-system cmake-build-system)
634 (inputs
635 `(("boost" ,boost)
636 ("fftw" ,fftw)
637 ("fftwf" ,fftwf)
638 ("hdf5" ,hdf5)
639 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
640 ; to create a configure-flag
641 ("libjpeg" ,libjpeg)
642 ("libpng" ,libpng)
643 ("libtiff" ,libtiff)
644 ("openexr" ,openexr)
645 ("python" ,python-2) ; print syntax
646 ("python2-numpy" ,python2-numpy)
647 ("zlib" ,zlib)))
648 (native-inputs
649 `(("doxygen" ,doxygen)
650 ("python2-nose" ,python2-nose)
651 ("python2-sphinx" ,python2-sphinx)))
652 (arguments
653 `(#:test-target "check"
654 #:parallel-build? #f ; parallel builds trigger an ICE
655 #:configure-flags
656 (list "-Wno-dev" ; suppress developer mode with lots of warnings
657 (string-append "-DVIGRANUMPY_INSTALL_DIR="
658 (assoc-ref %outputs "out")
659 "/lib/python2.7/site-packages")
660 ;; OpenEXR is not enabled by default.
661 "-DWITH_OPENEXR=1"
662 ;; The header files of ilmbase are not found when included
663 ;; by the header files of openexr, and an explicit flag
664 ;; needs to be set.
665 (string-append "-DCMAKE_CXX_FLAGS=-I"
666 (assoc-ref %build-inputs "ilmbase")
667 "/include/OpenEXR"))))
668 (synopsis "Computer vision library")
669 (description
670 "VIGRA stands for Vision with Generic Algorithms. It is an image
671 processing and analysis library that puts its main emphasis on customizable
672 algorithms and data structures. It is particularly strong for
673 multi-dimensional image processing.")
674 (license license:expat)
675 (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
676
677 (define-public libwebp
678 (package
679 (name "libwebp")
680 (version "0.4.3")
681 (source
682 (origin
683 (method url-fetch)
684 (uri (string-append
685 "http://downloads.webmproject.org/releases/webp/libwebp-" version
686 ".tar.gz"))
687 (sha256
688 (base32 "1i4hfczjm3b1qj1g4cc9hgb69l47f3nkgf6hk7nz4dm9zmc0vgpg"))))
689 (build-system gnu-build-system)
690 (inputs
691 `(("freeglut" ,freeglut)
692 ("giflib" ,giflib)
693 ("libjpeg" ,libjpeg)
694 ("libpng" ,libpng)
695 ("libtiff" ,libtiff)))
696 (arguments
697 '(#:configure-flags '("--enable-libwebpmux"
698 "--enable-libwebpdemux"
699 "--enable-libwebpdecoder")))
700 (home-page "https://developers.google.com/speed/webp/")
701 (synopsis "Lossless and lossy image compression")
702 (description
703 "WebP is a new image format that provides lossless and lossy compression
704 for images. WebP lossless images are 26% smaller in size compared to
705 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
706 equivalent SSIM index. WebP supports lossless transparency (also known as
707 alpha channel) with just 22% additional bytes. Transparency is also supported
708 with lossy compression and typically provides 3x smaller file sizes compared
709 to PNG when lossy compression is acceptable for the red/green/blue color
710 channels.")
711 (license license:bsd-3)))
712
713 (define-public libmng
714 (package
715 (name "libmng")
716 (version "2.0.3")
717 (source (origin
718 (method url-fetch)
719 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
720 version "/" name "-" version ".tar.xz"))
721 (sha256
722 (base32
723 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
724 (build-system gnu-build-system)
725 (propagated-inputs
726 ;; These are all in the 'Libs.private' field of libmng.pc.
727 `(("lcms" ,lcms)
728 ("libjpeg" ,libjpeg)
729 ("zlib" ,zlib)))
730 (home-page "http://www.libmng.com/")
731 (synopsis "Library for handling MNG files")
732 (description
733 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
734 (license license:bsd-3)))
735
736 (define-public devil
737 (package
738 (name "devil")
739 (version "1.7.8")
740 (source (origin
741 (method url-fetch)
742 (uri (string-append "http://downloads.sourceforge.net/openil/"
743 "DevIL-" version ".tar.gz"))
744 (sha256
745 (base32
746 "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"))
747 ;; Backported from upstream:
748 ;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch
749 (patches (search-patches "devil-fix-libpng.patch"
750 "devil-CVE-2009-3994.patch"))
751 (modules '((guix build utils)))
752 (snippet
753 ;; Fix old lcms include directives and lib flags.
754 '(substitute* '("configure" "src-IL/src/il_profiles.c")
755 (("-llcms") "-llcms2")
756 (("lcms/lcms\\.h") "lcms2/lcms2.h")
757 (("lcms\\.h") "lcms2.h")))))
758 (build-system gnu-build-system)
759 (arguments
760 '(#:configure-flags '("--enable-ILUT=yes") ; build utility library
761 #:phases
762 (modify-phases %standard-phases
763 (add-before 'check 'fix-tests
764 (lambda* (#:key inputs #:allow-other-keys)
765 ;; Fix hard-coded /bin/bash reference.
766 (substitute* '("test/Makefile")
767 (("TESTS_ENVIRONMENT = /bin/bash")
768 (string-append "TESTS_ENVIRONMENT = "
769 (assoc-ref inputs "bash")
770 "/bin/bash")))
771 #t)))))
772 (native-inputs
773 `(("pkg-config" ,pkg-config)))
774 (inputs
775 `(("lcms" ,lcms)
776 ("libjpeg" ,libjpeg)
777 ("libmng" ,libmng)
778 ("libpng" ,libpng)
779 ("libtiff" ,libtiff)
780 ("openexr" ,openexr)
781 ("zlib" ,zlib)))
782 (synopsis "Library for manipulating many image formats")
783 (description "Developer's Image Library (DevIL) is a library to develop
784 applications with support for many types of images. DevIL can load, save,
785 convert, manipulate, filter and display a wide variety of image formats.")
786 (home-page "http://openil.sourceforge.net")
787 (license license:lgpl2.1+)))
788
789 (define-public jasper
790 (package
791 (name "jasper")
792 (version "1.900.1")
793 (source (origin
794 (method url-fetch)
795 (uri (string-append "https://www.ece.uvic.ca/~frodo/jasper"
796 "/software/jasper-" version ".zip"))
797 (sha256
798 (base32
799 "154l7zk7yh3v8l2l6zm5s2alvd2fzkp6c9i18iajfbna5af5m43b"))
800 (patches (search-patches
801 "jasper-CVE-2007-2721.patch"
802 "jasper-CVE-2008-3520.patch"
803 "jasper-CVE-2008-3522.patch"
804 "jasper-CVE-2011-4516-and-CVE-2011-4517.patch"
805 "jasper-CVE-2014-8137.patch"
806 "jasper-CVE-2014-8138.patch"
807 "jasper-CVE-2014-8157.patch"
808 "jasper-CVE-2014-8158.patch"
809 "jasper-CVE-2014-9029.patch"
810 "jasper-CVE-2016-1577.patch"
811 "jasper-CVE-2016-1867.patch"
812 "jasper-CVE-2016-2089.patch"
813 "jasper-CVE-2016-2116.patch"))))
814 (build-system gnu-build-system)
815 (native-inputs
816 `(("unzip" ,unzip)))
817 (synopsis "JPEG-2000 library")
818 (description "The JasPer Project is an initiative to provide a reference
819 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
820 ISO/IEC 15444-1).")
821 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
822 (license (license:x11-style "file://LICENSE"))))
823
824 (define-public zimg
825 (package
826 (name "zimg")
827 (version "2.1")
828 (source
829 (origin
830 (method url-fetch)
831 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
832 "release-" version ".tar.gz"))
833 (file-name (string-append name "-" version ".tar.gz"))
834 (sha256
835 (base32
836 "1hqp1gcsa2zhypms5dnasb1srjgxdqm7cip3w5i571kk9nxkn289"))))
837 (build-system gnu-build-system)
838 (native-inputs
839 `(("autoconf" ,autoconf)
840 ("automake" ,automake)
841 ("libtool" ,libtool)))
842 (arguments
843 '(#:phases
844 (modify-phases %standard-phases
845 (add-after 'unpack 'autogen
846 (lambda _
847 (zero? (system* "sh" "autogen.sh")))))))
848 (synopsis "Scaling, colorspace conversion, and dithering library")
849 (description "Zimg implements the commonly required image processing basics
850 of scaling, colorspace conversion, and depth conversion. A simple API enables
851 conversion between any supported formats to operate with minimal knowledge from
852 the programmer.")
853 (home-page "https://github.com/sekrit-twc/zimg")
854 ;; test/extra/ contains musl-libm,
855 ;; which is MIT/expat licensed, but only used for tests
856 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
857
858 (define-public perceptualdiff
859 (package
860 (name "perceptualdiff")
861 (version "1.3")
862 (source
863 (origin
864 (method url-fetch)
865 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
866 version ".tar.gz"))
867 (file-name (string-append name "-" version ".tar.gz"))
868 (sha256
869 (base32
870 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
871 (build-system cmake-build-system)
872 (inputs `(("freeimage" ,freeimage)))
873 (arguments
874 '(#:phases (modify-phases %standard-phases
875 (add-after 'unpack 'fix-tests
876 ;; cmake-build-system uses a build/ directory outside
877 ;; of the source tree, one level higher than expected
878 (lambda _
879 (substitute* "test/run_tests.bash"
880 (("../build") "../../build")))))))
881 (home-page "https://github.com/myint/perceptualdiff")
882 (synopsis "Perceptual image comparison utility")
883 (description "PerceptualDiff visually compares two images to determine
884 whether they look alike. It uses a computational model of the human visual
885 system to detect similarities. This allows it too see beyond irrelevant
886 differences in file encoding, image quality, and other small variations.")
887 (license license:gpl2+)))
888
889 (define-public steghide
890 (package
891 (name "steghide")
892 (version "0.5.1")
893 (source (origin
894 (method url-fetch)
895 (uri (string-append "mirror://sourceforge/steghide/steghide/"
896 version "/steghide-" version ".tar.bz2"))
897 (sha256
898 (base32
899 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
900 (patches (list (search-patch "steghide-fixes.patch")))))
901 (build-system gnu-build-system)
902 (native-inputs
903 `(("gettext" ,gnu-gettext)
904 ("libtool" ,libtool)
905 ("perl" ,perl))) ;for tests
906 (inputs
907 `(("libmhash" ,libmhash)
908 ("libmcrypt" ,libmcrypt)
909 ("libjpeg" ,libjpeg)
910 ("zlib" ,zlib)))
911 (arguments
912 `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
913 (home-page "http://steghide.sourceforge.net")
914 (synopsis "Image and audio steganography")
915 (description
916 "Steghide is a steganography program that is able to hide data in various
917 kinds of image- and audio-files. The color- respectivly sample-frequencies
918 are not changed thus making the embedding resistant against first-order
919 statistical tests.")
920 (license license:gpl2+)))