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