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