gnu: facter: Update to 4.0.34.
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017, 2019 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, 2018, 2019 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, 2020 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 Nikita <nikita@n0.is>
17 ;;; Copyright © 2017,2019,2020 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 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
21 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
22 ;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
23 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
24 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
25 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
26 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
27 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
28 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
29 ;;;
30 ;;; This file is part of GNU Guix.
31 ;;;
32 ;;; GNU Guix is free software; you can redistribute it and/or modify it
33 ;;; under the terms of the GNU General Public License as published by
34 ;;; the Free Software Foundation; either version 3 of the License, or (at
35 ;;; your option) any later version.
36 ;;;
37 ;;; GNU Guix is distributed in the hope that it will be useful, but
38 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 ;;; GNU General Public License for more details.
41 ;;;
42 ;;; You should have received a copy of the GNU General Public License
43 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45 (define-module (gnu packages image)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages algebra)
48 #:use-module (gnu packages assembly)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages boost)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages cmake)
54 #:use-module (gnu packages curl)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages documentation)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages freedesktop)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages ghostscript)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages graphics)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages man)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages mcrypt)
69 #:use-module (gnu packages mp3)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages photo)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages python)
75 #:use-module (gnu packages python-xyz)
76 #:use-module (gnu packages qt)
77 #:use-module (gnu packages sphinx)
78 #:use-module (gnu packages textutils)
79 #:use-module (gnu packages video)
80 #:use-module (gnu packages web)
81 #:use-module (gnu packages xml)
82 #:use-module (gnu packages xorg)
83 #:use-module ((guix licenses) #:prefix license:)
84 #:use-module (guix packages)
85 #:use-module (guix download)
86 #:use-module (guix git-download)
87 #:use-module (guix utils)
88 #:use-module (guix build-system gnu)
89 #:use-module (guix build-system cmake)
90 #:use-module (guix build-system copy)
91 #:use-module (guix build-system meson)
92 #:use-module (guix build-system python)
93 #:use-module (guix build-system scons)
94 #:use-module (guix deprecation)
95 #:use-module (srfi srfi-1))
96
97 (define-public libpng
98 (package
99 (name "libpng")
100 (version "1.6.37")
101 (source (origin
102 (method url-fetch)
103 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
104 version "/libpng-" version ".tar.xz")
105 (string-append
106 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
107 "/libpng16/libpng-" version ".tar.xz")
108 (string-append
109 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
110 "/libpng16/libpng-" version ".tar.xz")))
111 (sha256
112 (base32
113 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
114 (build-system gnu-build-system)
115 (arguments
116 `(#:configure-flags '("--disable-static")))
117
118 ;; libpng.la says "-lz", so propagate it.
119 (propagated-inputs `(("zlib" ,zlib)))
120
121 (synopsis "Library for handling PNG files")
122 (description
123 "Libpng is the official PNG (Portable Network Graphics) reference
124 library. It supports almost all PNG features and is extensible.")
125 (license license:zlib)
126 (home-page "http://www.libpng.org/pub/png/libpng.html")))
127
128 ;; libpng-apng should be updated when the APNG patch is released:
129 ;; <https://bugs.gnu.org/27556>
130 (define-public libpng-apng
131 (package
132 (name "libpng-apng")
133 (version "1.6.28")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
138 version "/libpng-" version ".tar.xz")
139 (string-append
140 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
141 "/libpng16/libpng-" version ".tar.xz")
142 (string-append
143 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
144 "/libpng16/libpng-" version ".tar.xz")))
145 (sha256
146 (base32
147 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
148 (build-system gnu-build-system)
149 (arguments
150 `(#:modules ((guix build gnu-build-system)
151 (guix build utils)
152 (srfi srfi-1))
153 #:phases
154 (modify-phases %standard-phases
155 (add-after 'unpack 'patch-apng
156 (lambda* (#:key inputs #:allow-other-keys)
157 (define (apply-patch file)
158 (invoke "patch" "-p1" "--force"
159 "--input" file))
160 (let ((apng.gz (assoc-ref inputs "apng")))
161 (format #t "Applying APNG patch '~a'...~%"
162 apng.gz)
163 (invoke "sh" "-c"
164 (string-append "gunzip < " apng.gz " > the-patch"))
165 (apply-patch "the-patch")
166 #t)))
167 (add-before 'configure 'no-checks
168 (lambda _
169 (substitute* "Makefile.in"
170 (("^scripts/symbols.chk") "")
171 (("check: scripts/symbols.chk") ""))
172 #t)))))
173 (inputs
174 `(("apng" ,(origin
175 (method url-fetch)
176 (uri
177 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
178 version "/libpng-" version "-apng.patch.gz"))
179 (sha256
180 (base32
181 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
182 (native-inputs
183 `(("libtool" ,libtool)))
184 ;; libpng.la says "-lz", so propagate it.
185 (propagated-inputs
186 `(("zlib" ,zlib)))
187 (synopsis "APNG patch for libpng")
188 (description
189 "APNG (Animated Portable Network Graphics) is an unofficial
190 extension of the APNG (Portable Network Graphics) format.
191 APNG patch provides APNG support to libpng.")
192 (home-page "https://sourceforge.net/projects/libpng-apng/")
193 (license license:zlib)))
194
195 (define-public libpng-1.2
196 (package
197 (inherit libpng)
198 (version "1.2.59")
199 (source
200 (origin
201 (method url-fetch)
202 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
203 version "/libpng-" version ".tar.xz")
204 (string-append
205 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
206 "/libpng12/libpng-" version ".tar.xz")
207 (string-append
208 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
209 "/libpng12/libpng-" version ".tar.xz")))
210 (sha256
211 (base32
212 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
213
214 (define-public pngcrush
215 (package
216 (name "pngcrush")
217 (version "1.8.13")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
221 version "/pngcrush-" version "-nolib.tar.xz"))
222 (sha256 (base32
223 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
224 (build-system gnu-build-system)
225 (arguments
226 '(#:tests? #f ; no check target
227 #:phases
228 (modify-phases %standard-phases
229 (replace 'configure
230 (lambda* (#:key inputs outputs #:allow-other-keys)
231 (substitute* "Makefile"
232 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
233 (string-append vardef (assoc-ref inputs "libpng") "/"))
234 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
235 (string-append vardef (assoc-ref inputs "zlib") "/"))
236 ;; The Makefile is written by hand and not using $PREFIX
237 (("\\$\\(DESTDIR\\)/usr/")
238 (string-append (assoc-ref outputs "out") "/")))
239 #t)))))
240 (inputs
241 `(("libpng" ,libpng)
242 ("zlib" , zlib)))
243 (home-page "https://pmt.sourceforge.io/pngcrush")
244 (synopsis "Utility to compress PNG files")
245 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
246 images. It can further losslessly compress them by as much as 40%.")
247 (license license:zlib)))
248
249 (define-public pnglite
250 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
251 (revision "1"))
252 (package
253 (name "pnglite")
254 ;; The project was moved from sourceforge to github.
255 ;; The latest version in sourceforge was 0.1.17:
256 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
257 ;; No releases are made in github.
258 (version (git-version "0.1.17" revision commit))
259 (source (origin
260 (method git-fetch)
261 (uri (git-reference
262 (url "https://github.com/dankar/pnglite")
263 (commit commit)))
264 (sha256
265 (base32
266 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
267 (file-name (git-file-name name version))))
268 (build-system gnu-build-system)
269 (arguments
270 `(#:tests? #f ; no tests
271 #:phases
272 (modify-phases %standard-phases
273 (delete 'configure)
274 (replace 'build
275 (lambda _
276 ;; common build flags for building shared libraries
277 (let ((cflags '("-O2" "-g" "-fPIC"))
278 (ldflags '("-shared")))
279 (apply invoke
280 `("gcc"
281 "-o" "libpnglite.so"
282 ,@cflags
283 ,@ldflags
284 "pnglite.c"))
285 #t)))
286 (replace 'install
287 (lambda* (#:key outputs #:allow-other-keys)
288 (let* ((out (assoc-ref outputs "out"))
289 (lib (string-append out "/lib/"))
290 (include (string-append out "/include/"))
291 (doc (string-append out "/share/doc/"
292 ,name "-" ,version "/")))
293 (install-file "libpnglite.so" lib)
294 (install-file "pnglite.h" include)
295 (install-file "README.md" doc)
296 #t))))))
297 (inputs `(("zlib" ,zlib)))
298 (home-page "https://github.com/dankar/pnglite")
299 (synopsis "Pretty small png library")
300 (description "A pretty small png library.
301 Currently all documentation resides in @file{pnglite.h}.")
302 (license license:zlib))))
303
304 (define-public libimagequant
305 (package
306 (name "libimagequant")
307 (version "2.12.5")
308 (source
309 (origin
310 (method git-fetch)
311 (uri (git-reference
312 (url "https://github.com/ImageOptim/libimagequant")
313 (commit version)))
314 (file-name (git-file-name name version))
315 (sha256
316 (base32 "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k"))))
317 (build-system gnu-build-system)
318 (arguments
319 '(#:tests? #f)) ; no check target
320 (home-page "https://pngquant.org/lib/")
321 (synopsis "Image palette quantization library")
322 (description "libimagequant is a small, portable C library for
323 high-quality conversion of RGBA images to 8-bit indexed-color (palette)
324 images. This library can significantly reduces file sizes and powers pngquant
325 and other PNG optimizers.")
326 (license license:gpl3+)))
327
328 (define-public pngquant
329 (package
330 (name "pngquant")
331 (version "2.12.6")
332 (source
333 (origin
334 (method git-fetch)
335 (uri (git-reference
336 (url "https://github.com/kornelski/pngquant")
337 (commit version)))
338 (file-name (git-file-name name version))
339 (sha256
340 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
341 (build-system gnu-build-system)
342 (arguments
343 `(#:test-target "test"
344 #:configure-flags
345 '("--with-openmp" "--with-lcms2")))
346 (native-inputs
347 `(("pkg-config" ,pkg-config)))
348 (inputs
349 `(("libpng" ,libpng)
350 ("zlib" , zlib)
351 ("lcms" ,lcms)
352 ("libimagequant" ,libimagequant)))
353 (home-page "https://pngquant.org/")
354 (synopsis "Utility and library for lossy compressing PNG images")
355 (description "pngquant is a PNG compressor that significantly reduces file
356 sizes by converting images to a more efficient 8-bit PNG format with alpha
357 channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
358 are fully standards-compliant and are supported by all web browsers and
359 operating systems.
360
361 Features:
362 @enumerate
363 @item High-quality palette generation using a combination of vector
364 quantization algorithms.
365 @item Unique adaptive dithering algorithm that adds less noise to images
366 than the standard Floyd-Steinberg.
367 @item Easy to integrate with shell scripts, GUIs and server-side software.
368 @item Fast mode for real-time processing/large numbers of images.
369 @end enumerate")
370 (license license:gpl3+)))
371
372 (define-public ijg-libjpeg
373 (package
374 (name "libjpeg")
375 (version "9d")
376 (source (origin
377 (method url-fetch)
378 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
379 version ".tar.gz"))
380 (sha256 (base32
381 "0clwys9lcqlxqgcw8s1gwfm5ix2zjlqpklmd3mbvqmj5ibj51jwr"))))
382 (build-system gnu-build-system)
383 (synopsis "Library for handling JPEG files")
384 (description
385 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
386 JPEG is a standardized compression method for full-color and gray-scale
387 images.
388 It also includes programs that provide conversion between the JPEG format and
389 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
390 lossless JPEG manipulations such as rotation, scaling or cropping:
391 @enumerate
392 @item cjpeg
393 @item djpeg
394 @item jpegtran
395 @item rdjpgcom
396 @item wrjpgcom
397 @end enumerate")
398 (license license:ijg)
399 (home-page "https://www.ijg.org/")))
400
401 (define-public libjxr
402 (package
403 (name "libjxr")
404 (version "1.1")
405 (source (origin
406 ;; We are using the Debian source because CodePlex does not
407 ;; deliver an easily downloadable tarball.
408 (method url-fetch)
409 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
410 version ".orig.tar.gz"))
411 (sha256
412 (base32
413 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
414 (patch-flags '("-p1" "--binary"))
415 (patches (search-patches "libjxr-fix-function-signature.patch"
416 "libjxr-fix-typos.patch"))))
417 (build-system gnu-build-system)
418 (arguments
419 '(#:make-flags
420 (list "CC=gcc"
421 ;; A substitute* procedure call would be enough to add the -fPIC
422 ;; flag if there was no file decoding error.
423 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
424 ;; terminators" according to the file(1) utility.
425 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
426 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
427 #:tests? #f ; no check target
428 #:phases
429 (modify-phases %standard-phases
430 (delete 'configure) ; no configure script
431 (add-after 'build 'build-shared-library
432 (lambda _
433 ;; The Makefile uses optimization level 1, so the same
434 ;; level is used here for consistency.
435 (invoke "gcc" "-shared" "-fPIC" "-O"
436 ;; Common files.
437 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
438 "strTransform.o" "perfTimerANSI.o"
439 ;; Decoding files.
440 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
441 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
442 ;; Encoding files.
443 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
444 "strPredQuantEnc.o"
445 "-o" "libjpegxr.so")
446 (invoke "gcc" "-shared" "-fPIC" "-O"
447 ;; Glue files.
448 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
449 ;; Test files.
450 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
451 "JXRTestTif.o" "JXRTestYUV.o"
452 "-o" "libjxrglue.so")))
453 ;; The upstream makefile does not include an install phase.
454 (replace 'install
455 (lambda* (#:key outputs #:allow-other-keys)
456 (let* ((out (assoc-ref outputs "out"))
457 (bin (string-append out "/bin"))
458 (lib (string-append out "/lib"))
459 (include (string-append out "/include/jxrlib")))
460 (for-each (lambda (file)
461 (install-file file include)
462 (delete-file file))
463 (append
464 '("jxrgluelib/JXRGlue.h"
465 "jxrgluelib/JXRMeta.h"
466 "jxrtestlib/JXRTest.h"
467 "image/sys/windowsmediaphoto.h")
468 (find-files "common/include" "\\.h$")))
469 (for-each (lambda (file)
470 (install-file file lib)
471 (delete-file file))
472 (find-files "." "\\.(a|so)$"))
473 (for-each (lambda (file)
474 (install-file file bin)
475 (delete-file file))
476 '("JxrDecApp" "JxrEncApp")))
477 #t)))))
478 (synopsis "Implementation of the JPEG XR standard")
479 (description "JPEG XR is an approved ISO/IEC International standard (its
480 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
481 (license
482 (license:non-copyleft
483 "file://Makefile"
484 "See the header of the Makefile in the distribution."))
485 (home-page "https://jxrlib.codeplex.com/")))
486
487 (define-public jpegoptim
488 (package
489 (name "jpegoptim")
490 (version "1.4.6")
491 (source (origin
492 (method url-fetch)
493 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
494 version ".tar.gz"))
495 (sha256 (base32
496 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
497 (build-system gnu-build-system)
498 (inputs `(("libjpeg" ,libjpeg-turbo)))
499 (arguments
500 '(#:tests? #f)) ; no tests
501 (synopsis "Optimize JPEG images")
502 (description
503 "jpegoptim provides lossless optimization (based on optimizing
504 the Huffman tables) and \"lossy\" optimization based on setting
505 maximum quality factor.")
506 (license license:gpl2+)
507 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
508
509 (define-public libicns
510 (package
511 (name "libicns")
512 (version "0.8.1")
513 (source (origin
514 (method url-fetch)
515 (uri (string-append
516 "mirror://sourceforge/icns/"
517 "libicns-" version ".tar.gz"))
518 (sha256
519 (base32
520 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
521 (build-system gnu-build-system)
522 (inputs
523 `(("libpng" ,libpng)
524 ("jasper" ,jasper)))
525 (arguments
526 `(#:tests? #t)) ; No tests.
527 (home-page "http://icns.sourceforge.net/")
528 (synopsis "Library for handling Mac OS icns resource files")
529 (description
530 "Libicns is a library for the manipulation of Mac OS IconFamily resource
531 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
532 convert between PNG and ICNS. @command{icns2png} will extract image files from
533 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
534 with .desktop files. Additionally, @command{icontainer2png} is provided for
535 extracting icontainer icon files.")
536 (license (list license:lgpl2.1+ ; libicns
537 license:lgpl2.0+ ; src/apidocs.*
538 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
539
540 (define-public libtiff
541 (package
542 (name "libtiff")
543 (version "4.1.0")
544 (source
545 (origin
546 (method url-fetch)
547 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
548 version ".tar.gz"))
549 (sha256
550 (base32
551 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
552 (build-system gnu-build-system)
553 (outputs '("out"
554 "doc")) ;1.3 MiB of HTML documentation
555 (arguments
556 ;; Instead of using --docdir, this package has its own --with-docdir.
557 `(#:configure-flags (list (string-append "--with-docdir="
558 (assoc-ref %outputs "doc")
559 "/share/doc/"
560 ,name "-" ,version)
561 "--disable-static")))
562 (inputs `(("zlib" ,zlib)
563 ("libjpeg" ,libjpeg-turbo)))
564 (synopsis "Library for handling TIFF files")
565 (description
566 "Libtiff provides support for the Tag Image File Format (TIFF), a format
567 used for storing image data.
568 Included are a library, libtiff, for reading and writing TIFF and a small
569 collection of tools for doing simple manipulations of TIFF images.")
570 (license (license:non-copyleft "file://COPYRIGHT"
571 "See COPYRIGHT in the distribution."))
572 (home-page "http://www.simplesystems.org/libtiff/")))
573
574 (define-public leptonica
575 (package
576 (name "leptonica")
577 (version "1.74.4")
578 (source
579 (origin
580 (method git-fetch)
581 (uri (git-reference
582 (url "https://github.com/DanBloomberg/leptonica")
583 (commit version)))
584 (file-name (git-file-name name version))
585 (sha256
586 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
587 (build-system gnu-build-system)
588 (native-inputs
589 `(("gnuplot" ,gnuplot) ;needed for test suite
590 ("autoconf" ,autoconf)
591 ("automake" ,automake)
592 ("libtool" ,libtool)
593 ("pkg-config" ,pkg-config)))
594 (inputs
595 `(("giflib" ,giflib)
596 ("libjpeg" ,libjpeg-turbo)
597 ("libpng" ,libpng)
598 ("libtiff" ,libtiff)
599 ("libwebp" ,libwebp)
600 ("openjpeg" ,openjpeg)
601 ("zlib" ,zlib)))
602 (arguments
603 '(#:phases
604 (modify-phases %standard-phases
605 (add-after 'unpack 'patch-reg-wrapper
606 (lambda _
607 (substitute* "prog/reg_wrapper.sh"
608 ((" /bin/sh ")
609 (string-append " " (which "sh") " "))
610 (("which gnuplot")
611 "true"))
612 #t))
613 (add-after 'install 'provide-absolute-giflib-reference
614 (lambda* (#:key inputs outputs #:allow-other-keys)
615 (let ((out (assoc-ref outputs "out"))
616 (giflib (assoc-ref inputs "giflib")))
617 ;; Add an absolute reference to giflib to avoid propagation.
618 (with-directory-excursion (string-append out "/lib")
619 (substitute* '("liblept.la" "pkgconfig/lept.pc")
620 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))
621 #t))))))
622 (home-page "http://www.leptonica.com/")
623 (synopsis "Library and tools for image processing and analysis")
624 (description
625 "Leptonica is a C library and set of command-line tools for efficient
626 image processing and image analysis operations. It supports rasterop, affine
627 transformations, binary and grayscale morphology, rank order, and convolution,
628 seedfill and connected components, image transformations combining changes in
629 scale and pixel depth, and pixelwise masking, blending, enhancement, and
630 arithmetic ops.")
631 (license license:bsd-2)))
632
633 (define-public jbig2dec
634 (package
635 (name "jbig2dec")
636 (version "0.18")
637 (source (origin
638 (method url-fetch)
639 (uri (string-append "https://github.com/ArtifexSoftware"
640 "/ghostpdl-downloads/releases/download"
641 "/gs951/" name "-" version ".tar.gz"))
642 (sha256
643 (base32
644 "0pigfw2v0ppvr0lbysm69gx0zsa5q2q92yrb8af2j3im6x97f6cy"))))
645 (build-system gnu-build-system)
646 (arguments '(#:configure-flags '("--disable-static")
647 #:phases (modify-phases %standard-phases
648 (add-before 'bootstrap 'force-bootstrap
649 (lambda _
650 ;; XXX: jbig2dec 0.18 was released with
651 ;; a broken configure script, so we
652 ;; recreate the build system here.
653 ;; Remove the autoconf inputs below
654 ;; when deleting this code.
655 (delete-file "configure")
656 (delete-file "autogen.sh")
657 #t)))))
658 (native-inputs
659 `(("autoconf" ,autoconf)
660 ("automake" ,automake)
661 ("libtool" ,libtool)
662 ("python" ,python-wrapper))) ;for tests
663 (synopsis "Decoder of the JBIG2 image compression format")
664 (description
665 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
666 monochrome) images at moderately high resolution, and in particular scanned
667 paper documents. In this domain it is very efficient, offering compression
668 ratios on the order of 100:1.
669
670 This is a decoder only implementation, and currently is in the alpha
671 stage, meaning it doesn't completely work yet. However, it is
672 maintaining parity with available encoders, so it is useful for real
673 work.")
674 (home-page "https://jbig2dec.com")
675 (license license:gpl2+)))
676
677 (define-public jbigkit
678 (package
679 (name "jbigkit")
680 (version "2.1")
681 (source
682 (origin
683 (method url-fetch)
684 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
685 "download/jbigkit-" version ".tar.gz"))
686 (sha256
687 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
688 (modules '((guix build utils)))
689 (snippet
690 '(begin
691 ;; Remove files without clear licence information.
692 (for-each delete-file-recursively
693 (list "contrib" "examples"))
694 #t))))
695 (build-system gnu-build-system)
696 (outputs (list "out" "pbmtools"))
697 (arguments
698 `(#:modules ((srfi srfi-26)
699 ,@%gnu-build-system-modules)
700 #:phases
701 (modify-phases %standard-phases
702 (delete 'configure) ; no configure script
703 (replace 'install ; no ‘make install’ target
704 (lambda* (#:key outputs #:allow-other-keys)
705 (let* ((out (assoc-ref outputs "out"))
706 (lib (string-append out "/lib"))
707 (include (string-append out "/include")))
708 (with-directory-excursion "libjbig"
709 (for-each (cut install-file <> include)
710 (find-files "." "\\.h$"))
711 (for-each (cut install-file <> lib)
712 (find-files "." "\\.a$")))
713 #t)))
714 (add-after 'install 'install-pbmtools
715 (lambda* (#:key outputs #:allow-other-keys)
716 (let* ((out (assoc-ref outputs "pbmtools"))
717 (bin (string-append out "/bin"))
718 (man1 (string-append out "/share/man/man1"))
719 (man5 (string-append out "/share/man/man5")))
720 (with-directory-excursion "pbmtools"
721 (for-each (cut install-file <> bin)
722 (list "jbgtopbm" "jbgtopbm85"
723 "pbmtojbg" "pbmtojbg85"))
724
725 (for-each (cut install-file <> man1)
726 (find-files "." "\\.1$"))
727 (for-each (cut install-file <> man5)
728 (find-files "." "\\.5$"))
729 #t)))))
730 #:test-target "test"
731 #:tests? #f)) ; tests depend on examples/
732 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
733 (synopsis "Lossless compression for bi-level high-resolution images")
734 (description
735 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
736 ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
737 black-and-white scanned documents. It is widely used in fax products, printer
738 firmware and drivers, document management systems, and imaging software.
739
740 This package provides a static C library of (de)compression functions and some
741 simple command-line converters similar to those provided by netpbm.
742
743 Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
744 options of the standard but has to keep the full uncompressed image in memory.
745 The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
746 memory management optimized for embedded and fax applications. It buffers
747 only a few lines of the uncompressed image in memory and is able to stream
748 images of initially unknown height.")
749 (license (list license:isc ; pbmtools/p?m.5
750 license:gpl2+)))) ; the rest
751
752 (define-public openjpeg
753 (package
754 (name "openjpeg")
755 (version "2.3.1")
756 (source (origin
757 (method git-fetch)
758 (uri (git-reference
759 (url "https://github.com/uclouvain/openjpeg")
760 (commit (string-append "v" version))))
761 (file-name (git-file-name "openjpeg" version))
762 (sha256
763 (base32
764 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
765 (build-system cmake-build-system)
766 (arguments
767 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
768 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
769 (inputs
770 `(("lcms" ,lcms)
771 ("libpng" ,libpng)
772 ("libtiff" ,libtiff)
773 ("zlib" ,zlib)))
774 (synopsis "JPEG 2000 codec")
775 (description
776 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
777 been developed in order to promote the use of JPEG 2000, the new
778 still-image compression standard from the Joint Photographic Experts
779 Group (JPEG).
780
781 In addition to the basic codec, various other features are under
782 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
783 an indexing tool useful for the JPIP protocol, JPWL-tools for
784 error-resilience, a Java-viewer for j2k-images, ...")
785 (home-page "https://github.com/uclouvain/openjpeg")
786 (license license:bsd-2)))
787
788 (define-public openjpeg-1
789 (package (inherit openjpeg)
790 (name "openjpeg")
791 (version "1.5.2")
792 (source
793 (origin
794 (method url-fetch)
795 (uri
796 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
797 name "-" version ".tar.gz"))
798 (sha256
799 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
800
801 (define-public giflib
802 (package
803 (name "giflib")
804 (version "5.2.1")
805 (source (origin
806 (method url-fetch)
807 (uri (string-append "mirror://sourceforge/giflib/giflib-"
808 version ".tar.gz"))
809 (sha256
810 (base32
811 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
812 (build-system gnu-build-system)
813 (outputs '("bin" ; utility programs
814 "out")) ; library
815 (arguments
816 '(#:make-flags (list "CC=gcc"
817 (string-append "PREFIX="
818 (assoc-ref %outputs "out"))
819 (string-append "BINDIR="
820 (assoc-ref %outputs "bin") "/bin"))
821 #:phases
822 (modify-phases %standard-phases
823 (add-after 'unpack 'disable-html-doc-gen
824 (lambda _
825 (substitute* "doc/Makefile"
826 (("^all: allhtml manpages") ""))
827 #t))
828 (delete 'configure)
829 (add-after 'install 'install-manpages
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let* ((bin (assoc-ref outputs "bin"))
832 (man1dir (string-append bin "/share/man/man1")))
833 (mkdir-p man1dir)
834 (for-each (lambda (file)
835 (let ((base (basename file)))
836 (format #t "installing `~a' to `~a'~%"
837 base man1dir)
838 (copy-file file
839 (string-append
840 man1dir "/" base))))
841 (find-files "doc" "\\.1"))
842 #t))))))
843 (synopsis "Tools and library for working with GIF images")
844 (description
845 "GIFLIB is a library for reading and writing GIF images. It is API and
846 ABI compatible with libungif which was in wide use while the LZW compression
847 algorithm was patented. Tools are also included to convert, manipulate,
848 compose, and analyze GIF images.")
849 (home-page "http://giflib.sourceforge.net/")
850 (license license:x11)))
851
852 (define-public libuemf
853 (package
854 (name "libuemf")
855 (version "0.2.7")
856 (source (origin
857 (method url-fetch)
858 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
859 version ".tar.gz"))
860 (sha256
861 (base32
862 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
863 (build-system cmake-build-system)
864 (arguments
865 `(#:phases
866 (modify-phases %standard-phases
867 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
868 (add-after 'unpack 'fix-CMakeLists.txt
869 (lambda _
870 (substitute* "CMakeLists.txt"
871 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
872 #t))
873 (delete 'check)
874 (add-after 'install 'check
875 (lambda* (#:key inputs outputs #:allow-other-keys)
876 (let* ((out (assoc-ref outputs "out"))
877 (bin (string-append out "/bin"))
878 (sources (string-append "../libUEMF-" ,version))
879 (drm-tools (assoc-ref inputs "drm-tools"))
880 (extract (string-append drm-tools "/bin/extract"))
881 (execinput (string-append drm-tools "/bin/execinput")))
882 (with-directory-excursion sources
883 (substitute* "testit.sh"
884 (("^EPATH=.*")
885 (format #f "EPATH=~a~%" bin))
886 (("`which diff`")
887 "diff")
888 (("^EXTRACT=.*")
889 (format #f "EXTRACT=~a~%" extract))
890 (("^EXECINPUT=.*")
891 (format #f "EXECINPUT=~a~%" execinput)))
892 (invoke "sh" "testit.sh"))))))))
893 (native-inputs `(("drm-tools" ,drm-tools))) ;for tests
894 (home-page "http://libuemf.sourceforge.net/")
895 (synopsis "Library for working with WFM, EMF and EMF+ images")
896 (description "The libUEMF library is a portable C99 implementation for
897 reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
898 Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
899 (license license:gpl2+)))
900
901 (define-public libungif
902 (package
903 (name "libungif")
904 (version "4.1.4")
905 (source (origin
906 (method url-fetch)
907 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
908 "libungif-" version "/libungif-"
909 version ".tar.bz2"))
910 (sha256
911 (base32
912 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
913 (build-system gnu-build-system)
914 (inputs `(("perl" ,perl))) ;package ships some perl tools
915 (home-page "http://giflib.sourceforge.net/")
916 (synopsis "GIF decompression library")
917 (description
918 "libungif is the old GIF decompression library by the GIFLIB project.")
919 (license license:expat)))
920
921 (define-public imlib2
922 (package
923 (name "imlib2")
924 (version "1.6.1")
925 (source (origin
926 (method url-fetch)
927 (uri (string-append
928 "mirror://sourceforge/enlightenment/imlib2-src/" version
929 "/imlib2-" version ".tar.bz2"))
930 (sha256
931 (base32
932 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
933 (build-system gnu-build-system)
934 (native-inputs
935 `(("pkgconfig" ,pkg-config)))
936 (inputs
937 `(("bzip2" ,bzip2)
938 ("freetype" ,freetype)
939 ("giflib" ,giflib)
940 ("libid3tag" ,libid3tag)
941 ("libjpeg" ,libjpeg-turbo)
942 ("libpng" ,libpng)
943 ("libtiff" ,libtiff)
944 ("libx11" ,libx11)
945 ("libxext" ,libxext)
946 ("libwebp" ,libwebp)))
947 (home-page "https://sourceforge.net/projects/enlightenment/")
948 (synopsis
949 "Loading, saving, rendering and manipulating image files")
950 (description
951 "Imlib2 is a library that does image file loading and saving as well as
952 rendering, manipulation, arbitrary polygon support, etc.
953
954 It does ALL of these operations FAST. Imlib2 also tries to be highly
955 intelligent about doing them, so writing naive programs can be done easily,
956 without sacrificing speed.
957
958 This is a complete rewrite over the Imlib 1.x series. The architecture is
959 more modular, simple, and flexible.")
960 (license license:imlib2)))
961
962 (define-public giblib
963 (package
964 (name "giblib")
965 (version "1.2.4")
966 (source (origin
967 (method url-fetch)
968 (uri (list
969 (string-append
970 "http://linuxbrit.co.uk/downloads/giblib-"
971 version ".tar.gz")
972 (string-append
973 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
974 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
975 version ".tar.gz")
976 (string-append
977 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
978 "files/giblib/giblib-" version ".tar.gz")))
979 (sha256
980 (base32
981 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
982 (build-system gnu-build-system)
983 (inputs
984 `(("libx11" ,libx11)
985 ("imlib2" ,imlib2)))
986 (home-page
987 ;; This vanished page is universally accepted as giblib's home despite not
988 ;; mentioning the package once.
989 (string-append "https://web.archive.org/web/20140907071208/"
990 "https://linuxbrit.co.uk/software/"))
991 (synopsis "Wrapper library for imlib2")
992 (description
993 "Giblib is a simple library which wraps imlib2's context API, avoiding
994 all the context_get/set calls, adds fontstyles to the truetype renderer and
995 supplies a generic doubly-linked list and some string functions.")
996 ;; This license removes a clause about X Consortium from the original
997 ;; X11 license.
998 (license (license:x11-style "file://COPYING"
999 "See 'COPYING' in the distribution."))))
1000
1001 (define-public freeimage
1002 (package
1003 (name "freeimage")
1004 (version "3.18.0")
1005 (source (origin
1006 (method url-fetch)
1007 (uri (string-append
1008 "mirror://sourceforge/freeimage/Source%20Distribution/"
1009 version "/FreeImage"
1010 (string-concatenate (string-split version #\.))
1011 ".zip"))
1012 (sha256
1013 (base32
1014 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1015 (modules '((guix build utils)))
1016 (snippet
1017 '(begin
1018 (for-each
1019 (lambda (dir)
1020 (delete-file-recursively (string-append "Source/" dir)))
1021 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1022 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1023 (patches
1024 (append
1025 (search-patches "freeimage-unbundle.patch")
1026 ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
1027 (list (origin
1028 (method url-fetch)
1029 (uri "https://raw.githubusercontent.com/archlinux\
1030 /svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
1031 /freeimage-libraw-0.20.patch")
1032 (file-name "freeimage-libraw-compat.patch")
1033 (sha256
1034 (base32
1035 "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
1036 (build-system gnu-build-system)
1037 (arguments
1038 '(#:phases
1039 (modify-phases %standard-phases
1040 ;; According to Fedora these files depend on private headers, but their
1041 ;; presence is required for building, so we replace them with empty files.
1042 (add-after 'unpack 'delete-unbuildable-files
1043 (lambda _
1044 (for-each (lambda (file)
1045 (delete-file file)
1046 (close (open file O_CREAT)))
1047 '("Source/FreeImage/PluginG3.cpp"
1048 "Source/FreeImageToolkit/JPEGTransform.cpp"))
1049 #t))
1050 ;; These scripts generate the Makefiles.
1051 (replace 'configure
1052 (lambda _
1053 (invoke "sh" "gensrclist.sh")
1054 (invoke "sh" "genfipsrclist.sh")))
1055 (add-before 'build 'patch-makefile
1056 (lambda* (#:key outputs #:allow-other-keys)
1057 (substitute* "Makefile.gnu"
1058 (("/usr") (assoc-ref outputs "out"))
1059 (("-o root -g root") ""))
1060 #t)))
1061 #:make-flags
1062 (list "CC=gcc"
1063 ;; We need '-fpermissive' for Source/FreeImage.h.
1064 ;; libjxr doesn't have a pkg-config file.
1065 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
1066 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
1067 #:tests? #f)) ; no check target
1068 (native-inputs
1069 `(("pkg-config" ,pkg-config)
1070 ("unzip" ,unzip)))
1071 (inputs
1072 `(("libjpeg" ,libjpeg-turbo)
1073 ("libjxr" ,libjxr)
1074 ("libpng" ,libpng)
1075 ("libraw" ,libraw)
1076 ("libtiff" ,libtiff)
1077 ("libwebp" ,libwebp)
1078 ("openexr" ,openexr)
1079 ("openjpeg" ,openjpeg)
1080 ("zlib" ,zlib)))
1081 (synopsis "Library for handling popular graphics image formats")
1082 (description
1083 "FreeImage is a library for developers who would like to support popular
1084 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1085 (license license:gpl2+)
1086 (home-page "http://freeimage.sourceforge.net")))
1087
1088 (define-public vigra
1089 (package
1090 (name "vigra")
1091 (version "1.11.1")
1092 (source
1093 (origin
1094 (method url-fetch)
1095 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
1096 "Version-" (string-join (string-split version #\.) "-")
1097 "/vigra-" version "-src.tar.gz"))
1098 (patches (search-patches "vigra-python-compat.patch"))
1099 (sha256 (base32
1100 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
1101 (build-system cmake-build-system)
1102 (inputs
1103 `(("boost" ,boost)
1104 ("fftw" ,fftw)
1105 ("fftwf" ,fftwf)
1106 ("hdf5" ,hdf5)
1107 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1108 ; to create a configure-flag
1109 ("libjpeg" ,libjpeg-turbo)
1110 ("libpng" ,libpng)
1111 ("libtiff" ,libtiff)
1112 ("openexr" ,openexr)
1113 ("python" ,python-wrapper)
1114 ("python-numpy" ,python-numpy)
1115 ("zlib" ,zlib)))
1116 (native-inputs
1117 `(("doxygen" ,doxygen)
1118 ("python-nose" ,python-nose)
1119 ("sphinx" ,python-sphinx)))
1120 (arguments
1121 `(#:test-target "check"
1122 #:phases
1123 (modify-phases %standard-phases
1124 (add-after 'unpack 'disable-broken-tests
1125 (lambda _
1126 ;; See https://github.com/ukoethe/vigra/issues/432
1127 (substitute* "test/fourier/CMakeLists.txt"
1128 (("VIGRA_ADD_TEST.*") ""))
1129 ;; This test fails with Numpy 1.15:
1130 ;; <https://github.com/ukoethe/vigra/issues/436>.
1131 (substitute* "vigranumpy/test/CMakeLists.txt"
1132 (("test1\\.py") ""))
1133 #t)))
1134 #:configure-flags
1135 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1136 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1137 (assoc-ref %outputs "out")
1138 "/lib/python"
1139 ,(version-major+minor (package-version python))
1140 "/site-packages")
1141 ;; OpenEXR is not enabled by default.
1142 "-DWITH_OPENEXR=1"
1143 ;; Fix rounding error on 32-bit machines
1144 "-DCMAKE_C_FLAGS=-ffloat-store"
1145 ;; The header files of ilmbase are not found when included
1146 ;; by the header files of openexr, and an explicit flag
1147 ;; needs to be set.
1148 (string-append "-DCMAKE_CXX_FLAGS=-I"
1149 (assoc-ref %build-inputs "ilmbase")
1150 "/include/OpenEXR"
1151 " -ffloat-store"))))
1152 (synopsis "Computer vision library")
1153 (description
1154 "VIGRA stands for Vision with Generic Algorithms. It is an image
1155 processing and analysis library that puts its main emphasis on customizable
1156 algorithms and data structures. It is particularly strong for
1157 multi-dimensional image processing.")
1158 (license license:expat)
1159 (home-page "https://ukoethe.github.io/vigra/")))
1160
1161 (define-public vigra-c
1162 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1163 (revision "1"))
1164 (package
1165 (name "vigra-c")
1166 (version (git-version "0.0.0" revision commit))
1167 (home-page "https://github.com/BSeppke/vigra_c")
1168 (source (origin
1169 (method git-fetch)
1170 (uri (git-reference
1171 (url home-page)
1172 (commit commit)))
1173 (sha256
1174 (base32
1175 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
1176 (file-name (git-file-name name version))))
1177 (build-system cmake-build-system)
1178 (arguments
1179 `(#:tests? #f)) ; No test target.
1180 (native-inputs
1181 `(("doxygen" ,doxygen)))
1182 (inputs
1183 `(("fftw" ,fftw)
1184 ("fftwf" ,fftwf)
1185 ("hdf5" ,hdf5)
1186 ("vigra" ,vigra)))
1187 (synopsis "C interface to the VIGRA computer vision library")
1188 (description
1189 "This package provides a C interface to the VIGRA C++ computer vision
1190 library. It is designed primarily to ease the implementation of higher-level
1191 language bindings to VIGRA.")
1192 (license license:expat))))
1193
1194 (define-public libwebp
1195 (package
1196 (name "libwebp")
1197 (version "1.1.0")
1198 (source
1199 (origin
1200 ;; No tarballs are provided for >0.6.1.
1201 (method git-fetch)
1202 (uri (git-reference
1203 (url "https://chromium.googlesource.com/webm/libwebp")
1204 (commit (string-append "v" version))))
1205 (file-name (git-file-name name version))
1206 (sha256
1207 (base32
1208 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
1209 (build-system gnu-build-system)
1210 (inputs
1211 `(("freeglut" ,freeglut)
1212 ("giflib" ,giflib)
1213 ("libjpeg" ,libjpeg-turbo)
1214 ("libpng" ,libpng)
1215 ("libtiff" ,libtiff)))
1216 (native-inputs
1217 `(("autoconf" ,autoconf)
1218 ("automake" ,automake)
1219 ("libtool" ,libtool)))
1220 (arguments
1221 '(#:configure-flags '("--enable-libwebpmux"
1222 "--enable-libwebpdemux"
1223 "--enable-libwebpdecoder"
1224 "--disable-static")))
1225 (home-page "https://developers.google.com/speed/webp/")
1226 (synopsis "Lossless and lossy image compression")
1227 (description
1228 "WebP is a new image format that provides lossless and lossy compression
1229 for images. WebP lossless images are 26% smaller in size compared to
1230 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1231 equivalent SSIM index. WebP supports lossless transparency (also known as
1232 alpha channel) with just 22% additional bytes. Transparency is also supported
1233 with lossy compression and typically provides 3x smaller file sizes compared
1234 to PNG when lossy compression is acceptable for the red/green/blue color
1235 channels.")
1236 (license license:bsd-3)))
1237
1238 (define-public libmng
1239 (package
1240 (name "libmng")
1241 (version "2.0.3")
1242 (source (origin
1243 (method url-fetch)
1244 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1245 version "/" name "-" version ".tar.xz"))
1246 (sha256
1247 (base32
1248 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1249 (build-system gnu-build-system)
1250 (propagated-inputs
1251 ;; These are all in the 'Libs.private' field of libmng.pc.
1252 `(("lcms" ,lcms)
1253 ("libjpeg" ,libjpeg-turbo)
1254 ("zlib" ,zlib)))
1255 (home-page "https://www.libmng.com/")
1256 (synopsis "Library for handling MNG files")
1257 (description
1258 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1259 (license license:bsd-3)))
1260
1261 (define-public exiv2
1262 (package
1263 (name "exiv2")
1264 (version "0.27.3")
1265 (source
1266 (origin
1267 (method url-fetch)
1268 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1269 "-Source.tar.gz"))
1270 (sha256
1271 (base32 "0y77wfadjsrcxijdqgkr3q88b6mm9y3rg8kqsmaig8iah49md7x7"))))
1272 (build-system cmake-build-system)
1273 (arguments '(#:tests? #f)) ; no test suite
1274 (propagated-inputs
1275 `(("expat" ,expat)
1276 ("zlib" ,zlib)))
1277 (home-page "https://www.exiv2.org/")
1278 (synopsis "Library and command-line utility to manage image metadata")
1279 (description
1280 "Exiv2 is a C++ library and a command line utility to manage image
1281 metadata. It provides fast and easy read and write access to the Exif, IPTC
1282 and XMP metadata of images in various formats.")
1283
1284 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1285 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1286 ;; The core is GPLv2+:
1287 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1288 (license license:gpl2+)))
1289
1290 (define-public exiv2-0.26
1291 (package
1292 (inherit exiv2)
1293 (version "0.26")
1294 (source (origin
1295 (method url-fetch)
1296 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1297 version "-trunk.tar.gz")
1298 (string-append "https://www.exiv2.org/exiv2-"
1299 version ".tar.gz")
1300 (string-append "https://fossies.org/linux/misc/exiv2-"
1301 version ".tar.gz")))
1302 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1303 "exiv2-CVE-2017-14859-14862-14864.patch"))
1304 (sha256
1305 (base32
1306 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1307 (build-system gnu-build-system)
1308 (arguments '(#:tests? #f)) ; no `check' target
1309 (propagated-inputs
1310 `(("expat" ,expat)
1311 ("zlib" ,zlib)))
1312 (native-inputs
1313 `(("intltool" ,intltool)))
1314
1315 ;; People should rely on the newer version, so don't expose it.
1316 (properties `((hidden? . #t)))))
1317
1318 (define-public devil
1319 (package
1320 (name "devil")
1321 (version "1.8.0")
1322 (source (origin
1323 (method url-fetch)
1324 (uri (string-append "http://downloads.sourceforge.net/openil/"
1325 "DevIL-" version ".tar.gz"))
1326 (sha256
1327 (base32
1328 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1329 (build-system cmake-build-system)
1330 (arguments
1331 '(;; XXX: Not supported in the released CMakeLists.txt.
1332 ;; Enable this for > 1.8.0.
1333 #:tests? #f
1334 #:phases
1335 (modify-phases %standard-phases
1336 (add-before 'configure 'change-directory
1337 (lambda _ (chdir "DevIL") #t)))))
1338 (native-inputs
1339 `(("pkg-config" ,pkg-config)))
1340 (inputs
1341 `(("lcms" ,lcms)
1342 ("libjpeg" ,libjpeg-turbo)
1343 ("libmng" ,libmng)
1344 ("libpng" ,libpng)
1345 ("libtiff" ,libtiff)
1346 ("openexr" ,openexr)
1347 ("zlib" ,zlib)))
1348 (synopsis "Library for manipulating many image formats")
1349 (description "Developer's Image Library (DevIL) is a library to develop
1350 applications with support for many types of images. DevIL can load, save,
1351 convert, manipulate, filter and display a wide variety of image formats.")
1352 (home-page "http://openil.sourceforge.net")
1353 (license license:lgpl2.1+)))
1354
1355 (define-public jasper
1356 (package
1357 (name "jasper")
1358 (version "2.0.19")
1359 (source (origin
1360 (method git-fetch)
1361 (uri (git-reference
1362 (url "https://github.com/mdadams/jasper")
1363 (commit (string-append "version-" version))))
1364 (file-name (git-file-name name version))
1365 (sha256
1366 (base32
1367 "036rcr0wkz9gzmvk1jb96piznk0c0bwxgf31z1zrlg8js4zl1n84"))))
1368 (build-system cmake-build-system)
1369 (inputs `(("libjpeg" ,libjpeg-turbo)))
1370 (synopsis "JPEG-2000 library")
1371 (description "The JasPer Project is an initiative to provide a reference
1372 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1373 ISO/IEC 15444-1).")
1374 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1375 (license (license:x11-style "file://LICENSE"))))
1376
1377 (define-public zimg
1378 (package
1379 (name "zimg")
1380 (version "2.9.3")
1381 (source
1382 (origin
1383 (method git-fetch)
1384 (uri (git-reference
1385 (url "https://github.com/sekrit-twc/zimg")
1386 (commit (string-append "release-" version))))
1387 (file-name (git-file-name name version))
1388 (sha256
1389 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
1390 (build-system gnu-build-system)
1391 (native-inputs
1392 `(("autoconf" ,autoconf)
1393 ("automake" ,automake)
1394 ("libtool" ,libtool)))
1395 (synopsis "Scaling, colorspace conversion, and dithering library")
1396 (description "Zimg implements the commonly required image processing basics
1397 of scaling, colorspace conversion, and depth conversion. A simple API enables
1398 conversion between any supported formats to operate with minimal knowledge from
1399 the programmer.")
1400 (home-page "https://github.com/sekrit-twc/zimg")
1401 ;; test/extra/ contains musl-libm,
1402 ;; which is MIT/expat licensed, but only used for tests
1403 (license license:wtfpl2)))
1404
1405 (define-public perceptualdiff
1406 (package
1407 (name "perceptualdiff")
1408 (version "1.3")
1409 (source
1410 (origin
1411 (method git-fetch)
1412 (uri (git-reference
1413 (url "https://github.com/myint/perceptualdiff")
1414 (commit (string-append "v" version))))
1415 (file-name (git-file-name name version))
1416 (sha256
1417 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
1418 (build-system cmake-build-system)
1419 (inputs `(("freeimage" ,freeimage)))
1420 (arguments
1421 '(#:phases (modify-phases %standard-phases
1422 (add-after 'unpack 'fix-tests
1423 ;; cmake-build-system uses a build/ directory outside
1424 ;; of the source tree, one level higher than expected
1425 (lambda _
1426 (substitute* "test/run_tests.bash"
1427 (("../build") "../../build"))
1428 #t)))))
1429 (home-page "https://github.com/myint/perceptualdiff")
1430 (synopsis "Perceptual image comparison utility")
1431 (description "PerceptualDiff visually compares two images to determine
1432 whether they look alike. It uses a computational model of the human visual
1433 system to detect similarities. This allows it too see beyond irrelevant
1434 differences in file encoding, image quality, and other small variations.")
1435 (license license:gpl2+)))
1436
1437 (define-public steghide
1438 (package
1439 (name "steghide")
1440 (version "0.5.1")
1441 (source (origin
1442 (method url-fetch)
1443 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1444 version "/steghide-" version ".tar.bz2"))
1445 (sha256
1446 (base32
1447 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1448 (patches (list (search-patch "steghide-fixes.patch")))))
1449 (build-system gnu-build-system)
1450 (native-inputs
1451 `(("gettext" ,gettext-minimal)
1452 ("libtool" ,libtool)
1453 ("perl" ,perl))) ;for tests
1454 (inputs
1455 `(("libmhash" ,libmhash)
1456 ("libmcrypt" ,libmcrypt)
1457 ("libjpeg" ,libjpeg-turbo)
1458 ("zlib" ,zlib)))
1459 (arguments
1460 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1461
1462 #:phases (modify-phases %standard-phases
1463 (add-before 'configure 'set-perl-search-path
1464 (lambda _
1465 ;; Work around "dotless @INC" build failure.
1466 (setenv "PERL5LIB"
1467 (string-append (getcwd) "/tests:"
1468 (getenv "PERL5LIB")))
1469 #t)))))
1470 (home-page "http://steghide.sourceforge.net")
1471 (synopsis "Image and audio steganography")
1472 (description
1473 "Steghide is a program to hide data in various kinds of image and audio
1474 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1475 changed, making the embedding resistant against first-order statistical tests.")
1476 (license license:gpl2+)))
1477
1478 (define-public stb-image-for-extempore
1479 (let ((revision "1")
1480 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1481 (package
1482 (name "stb-image-for-extempore")
1483 (version (string-append "0-" revision "." (string-take commit 9)))
1484 (source
1485 (origin (method git-fetch)
1486 (uri (git-reference
1487 (url "https://github.com/extemporelang/stb")
1488 (commit commit)))
1489 (sha256
1490 (base32
1491 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1492 (file-name (string-append name "-" version "-checkout"))))
1493 (build-system cmake-build-system)
1494 (arguments `(#:tests? #f)) ; no tests included
1495 ;; Extempore refuses to build on architectures other than x86_64
1496 (supported-systems '("x86_64-linux"))
1497 (home-page "https://github.com/extemporelang/stb")
1498 (synopsis "Image library for Extempore")
1499 (description
1500 "This package is a collection of assorted single-file libraries. Of
1501 all included libraries only the image loading and decoding library is
1502 installed as @code{stb_image}.")
1503 (license license:public-domain))))
1504
1505 (define-public optipng
1506 (package
1507 (name "optipng")
1508 (version "0.7.7")
1509 (source
1510 (origin
1511 (method url-fetch)
1512 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1513 version ".tar.gz"))
1514 (sha256
1515 (base32
1516 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1517 (modules '((guix build utils)))
1518 (snippet
1519 '(begin
1520 (delete-file-recursively "src/libpng")
1521 (delete-file-recursively "src/zlib")
1522 #t))))
1523 (build-system gnu-build-system)
1524 (inputs
1525 `(("libpng" ,libpng)
1526 ("zlib" ,zlib)))
1527 (arguments
1528 '(#:phases
1529 (modify-phases %standard-phases
1530 (replace 'configure
1531 (lambda* (#:key outputs #:allow-other-keys)
1532 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1533 (invoke "sh" "configure"
1534 (string-append "--prefix=" (assoc-ref outputs "out"))
1535 "-with-system-libs")
1536 #t)))))
1537 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1538 (description "OptiPNG is a PNG optimizer that recompresses image
1539 files to a smaller size, without losing any information. This program
1540 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1541 PNG, and performs PNG integrity checks and corrections.")
1542 (home-page "http://optipng.sourceforge.net/")
1543 (license license:zlib)))
1544
1545 (define-public pngsuite
1546 (package
1547 (name "pngsuite")
1548 (version "2017jul19")
1549 (source
1550 (origin
1551 (method url-fetch/tarbomb)
1552 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1553 version ".tgz"))
1554 (sha256
1555 (base32
1556 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1557 (build-system gnu-build-system)
1558 (arguments
1559 '(#:tests? #f ; there is no test target
1560 #:license-file-regexp "PngSuite.LICENSE"
1561 #:phases
1562 (modify-phases %standard-phases
1563 (replace 'install
1564 (lambda* (#:key outputs #:allow-other-keys)
1565 (let ((out (assoc-ref outputs "out")))
1566 (copy-recursively "." (string-append out "/"))
1567 #t)))
1568 (delete 'build)
1569 (delete 'configure))))
1570 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1571 (synopsis "Example PNGs for use in test suites")
1572 (description "Collection of graphics images created to test PNG
1573 applications like viewers, converters and editors. As far as that is
1574 possible, all formats supported by the PNG standard are represented.")
1575 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1576 use, copy, modify and distribute these images for any purpose and without fee
1577 is hereby granted."))))
1578
1579 (define-public libjpeg-turbo
1580 (package
1581 (name "libjpeg-turbo")
1582 (version "2.0.4")
1583 (replacement libjpeg-turbo/fixed)
1584 (source (origin
1585 (method url-fetch)
1586 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1587 version "/libjpeg-turbo-" version ".tar.gz"))
1588 (sha256
1589 (base32
1590 "01ill8bgjyk582wipx7sh7gj2nidylpbzvwhx0wkcm6mxx3qbp9k"))))
1591 (build-system cmake-build-system)
1592 (native-inputs
1593 `(("nasm" ,nasm)))
1594 (arguments
1595 `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1596 "-DENABLE_STATIC=0"
1597 ;; djpeg-shared-3x2-float-prog-cmp fails on 32-bit PPC.
1598 ,@(if (string=? "powerpc-linux" (%current-system))
1599 `("-DFLOATTEST=NO")
1600 '())
1601 ;; The build system probes for the current CPU, but
1602 ;; that fails when cross-compiling.
1603 ,@(let ((target (%current-target-system)))
1604 (if target
1605 (cond
1606 ((string-prefix? "arm" target)
1607 `("-DCMAKE_SYSTEM_PROCESSOR=arm"))
1608 ((string-prefix? "aarch64" target)
1609 `("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
1610 ((string-prefix? "i686" target)
1611 `("-DCMAKE_SYSTEM_PROCESSOR=x86"))
1612 ((string-prefix? "x86_64" target)
1613 `("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
1614 ;; 32-bit and 64-bit
1615 ((string-prefix? "powerpc" target)
1616 `("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
1617 (else '()))
1618 '())))
1619 ,@(if (%current-target-system)
1620 '()
1621 ;; Use a special "bootstrap" CMake for the native build to work
1622 ;; around a circular dependency between CMake and this package.
1623 `(#:cmake ,cmake-bootstrap))))
1624 (home-page "https://libjpeg-turbo.org/")
1625 (synopsis "SIMD-accelerated JPEG image handling library")
1626 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1627 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1628 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1629 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1630 a significant amount.
1631 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1632 but more straightforward TurboJPEG API, and provides a full-featured Java
1633 interface. It supports color space extensions that allow it to compress from
1634 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1635 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1636 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1637 license:ijg ;the libjpeg library and associated tools
1638 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1639
1640 (define libjpeg-turbo/fixed
1641 (package
1642 (inherit libjpeg-turbo)
1643 (version "2.0.5")
1644 (source (origin
1645 (method url-fetch)
1646 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1647 version "/libjpeg-turbo-" version ".tar.gz"))
1648 (sha256
1649 (base32
1650 "0pbv6pc97kbj7ib31qcwi7lnmm9xg5y3b11aasmkhfjvf7rgdy0n"))))))
1651
1652 (define-deprecated libjpeg libjpeg-turbo)
1653 (export libjpeg)
1654
1655 (define-public niftilib
1656 (package
1657 (name "niftilib")
1658 (version "2.0.0")
1659 (source (origin
1660 (method url-fetch)
1661 (uri (list (string-append "mirror://sourceforge/niftilib/"
1662 "nifticlib/nifticlib_"
1663 (string-join (string-split version #\.) "_")
1664 "/nifticlib-" version ".tar.gz")))
1665 (sha256
1666 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1667 (build-system gnu-build-system)
1668 (arguments
1669 '(#:tests? #f ; there is no test target
1670 #:parallel-build? #f ; not supported
1671 #:make-flags
1672 (list "SHELL=bash"
1673 (string-append "ZLIB_INC="
1674 (assoc-ref %build-inputs "zlib") "/include")
1675 ;; Append "-fPIC" to CFLAGS.
1676 (string-append "CFLAGS="
1677 "-Wall -ansi -pedantic -fPIC"))
1678 #:phases
1679 (modify-phases %standard-phases
1680 (replace 'install
1681 (lambda* (#:key outputs #:allow-other-keys)
1682 (let ((out (assoc-ref outputs "out")))
1683 (for-each
1684 (lambda (dir)
1685 (copy-recursively dir (string-append out "/" dir)))
1686 '("bin" "lib" "include")))
1687 #t))
1688 (delete 'configure))))
1689 (inputs
1690 `(("zlib" ,zlib)))
1691 (synopsis "Library for reading and writing files in the nifti-1 format")
1692 (description "Niftilib is a set of i/o libraries for reading and writing
1693 files in the nifti-1 data format - a binary file format for storing
1694 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1695 (fMRI) brain images.")
1696 (home-page "http://niftilib.sourceforge.net")
1697 (license license:public-domain)))
1698
1699 (define-public gpick
1700 (package
1701 (name "gpick")
1702 (version "0.2.5")
1703 (source (origin
1704 (method git-fetch)
1705 (uri (git-reference
1706 (url "https://github.com/thezbyg/gpick")
1707 (commit (string-append name "-" version))))
1708 (file-name (git-file-name name version))
1709 (sha256
1710 (base32
1711 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
1712 (build-system scons-build-system)
1713 (native-inputs
1714 `(("boost" ,boost)
1715 ("gettext" ,gettext-minimal)
1716 ("pkg-config" ,pkg-config)))
1717 (inputs
1718 `(("expat" ,expat)
1719 ("gtk2" ,gtk+-2)
1720 ("lua" ,lua-5.2)))
1721 (arguments
1722 `(#:tests? #f
1723 #:scons ,scons-python2
1724 #:scons-flags (list (string-append "DESTDIR=" %output))
1725 #:phases
1726 (modify-phases %standard-phases
1727 (add-before 'build 'fix-lua-reference
1728 (lambda _
1729 (substitute* "SConscript"
1730 (("lua5.2") "lua-5.2"))
1731 #t)))))
1732 (home-page "http://www.gpick.org/")
1733 (synopsis "Color picker")
1734 (description "Gpick is an advanced color picker and palette editing tool.")
1735 (license license:bsd-3)))
1736
1737 (define-public libiptcdata
1738 (package
1739 (name "libiptcdata")
1740 (version "1.0.5")
1741 (source (origin
1742 (method url-fetch)
1743 (uri (string-append "https://github.com/ianw/libiptcdata"
1744 "/releases/download/release_"
1745 (string-join (string-split version #\.) "_")
1746 "/" name "-" version ".tar.gz"))
1747 (sha256
1748 (base32
1749 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1750 (build-system gnu-build-system)
1751 (home-page "https://github.com/ianw/libiptcdata")
1752 (synopsis "IPTC metadata manipulation library")
1753 (description
1754 "Libiptcdata is a C library for manipulating the International Press
1755 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1756 such as images. This metadata can include captions and keywords, often used by
1757 popular photo management applications. The library provides routines for
1758 parsing, viewing, modifying, and saving this metadata.")
1759 (license license:lgpl2.0+)))
1760
1761 (define-public flameshot
1762 (package
1763 (name "flameshot")
1764 (version "0.5.1")
1765 (source
1766 (origin
1767 (method git-fetch)
1768 (uri (git-reference
1769 (url "https://github.com/lupoDharkael/flameshot")
1770 (commit (string-append "v" version))))
1771 (file-name (git-file-name name version))
1772 (sha256
1773 (base32
1774 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
1775 (build-system gnu-build-system)
1776 (native-inputs
1777 `(("qttools" ,qttools)))
1778 (inputs
1779 `(("qtbase" ,qtbase)))
1780 (arguments
1781 `(#:tests? #f ; no tests
1782 #:phases
1783 (modify-phases %standard-phases
1784 (replace 'configure
1785 (lambda* (#:key outputs #:allow-other-keys)
1786 (invoke "qmake"
1787 "CONFIG+=packaging"
1788 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1789 "PREFIX=/"))))))
1790 (home-page "https://github.com/lupoDharkael/flameshot")
1791 (synopsis "Powerful yet simple to use screenshot software")
1792 (description "Flameshot is a screenshot program.
1793 Features:
1794
1795 @itemize
1796 @item Customizable appearance.
1797 @item Easy to use.
1798 @item In-app screenshot edition.
1799 @item DBus interface.
1800 @item Upload to Imgur.
1801 @end itemize\n")
1802 (license license:gpl3+)))
1803
1804 (define-public gifsicle
1805 (package
1806 (name "gifsicle")
1807 (version "1.92")
1808 (source
1809 (origin
1810 (method url-fetch)
1811 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
1812 version ".tar.gz"))
1813 (sha256
1814 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
1815 (build-system gnu-build-system)
1816 (arguments
1817 '(#:phases
1818 (modify-phases %standard-phases
1819 (add-before 'check 'patch-tests
1820 (lambda _
1821 (substitute* "test/testie"
1822 (("/usr/bin/perl")
1823 (which "perl"))
1824 (("/bin/sh")
1825 (which "sh"))
1826 (("/bin/rm")
1827 (which "rm")))
1828 #t)))))
1829 (native-inputs `(("perl" ,perl))) ; only for tests
1830 (inputs `(("libx11" ,libx11)))
1831 (home-page "https://www.lcdf.org/gifsicle/")
1832 (synopsis "Edit GIF images and animations")
1833 (description "Gifsicle is a command-line GIF image manipulation tool that:
1834
1835 @itemize
1836 @item Provides a batch mode for changing GIFs in place.
1837 @item Prints detailed information about GIFs, including comments.
1838 @item Control over interlacing, comments, looping, transparency, etc.
1839 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1840 tables, etc.
1841 @item Shrinks colormaps and change images to use the Web-safe palette.
1842 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1843 @end itemize
1844
1845 Two other programs are included with Gifsicle: @command{gifview} is a
1846 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1847 identical visual appearance.")
1848 (license license:gpl2+)))
1849
1850 ;; 1.0.7 is buggy and reverted in git repository.
1851 (define-public jp2a
1852 (package
1853 (name "jp2a")
1854 (version "1.0.6")
1855 (source
1856 (origin
1857 (method url-fetch)
1858 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1859 version ".orig.tar.gz"))
1860 (sha256
1861 (base32
1862 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
1863 (build-system gnu-build-system)
1864 (inputs
1865 `(("curl" ,curl)
1866 ("libjpeg" ,libjpeg-turbo)
1867 ("ncurses" ,ncurses)))
1868 (home-page "https://csl.name/jp2a/")
1869 (synopsis "Convert JPEG images to ASCII")
1870 (description
1871 "Jp2a is a small utility that converts JPEG images to ASCII.")
1872 (license license:gpl2)))
1873
1874 (define-public grim
1875 (package
1876 (name "grim")
1877 (version "1.2.0")
1878 (source
1879 (origin
1880 (method git-fetch)
1881 (uri (git-reference
1882 (url "https://github.com/emersion/grim")
1883 (commit (string-append "v" version))))
1884 (file-name (git-file-name name version))
1885 (sha256
1886 (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
1887 (build-system meson-build-system)
1888 (native-inputs `(("pkg-config" ,pkg-config)
1889 ("scdoc" ,scdoc)))
1890 (inputs `(("cairo" ,cairo)
1891 ("libjpeg-turbo" ,libjpeg-turbo)
1892 ("wayland" ,wayland)
1893 ("wayland-protocols" ,wayland-protocols)))
1894 (home-page "https://github.com/emersion/grim")
1895 (synopsis "Create screenshots from a Wayland compositor")
1896 (description "grim can create screenshots from a Wayland compositor.")
1897 ;; MIT license.
1898 (license license:expat)))
1899
1900 (define-public slurp
1901 (package
1902 (name "slurp")
1903 (version "1.2.0")
1904 (source
1905 (origin
1906 (method git-fetch)
1907 (uri (git-reference
1908 (url "https://github.com/emersion/slurp")
1909 (commit (string-append "v" version))))
1910 (file-name (git-file-name name version))
1911 (sha256
1912 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
1913 (build-system meson-build-system)
1914 (native-inputs `(("pkg-config" ,pkg-config)))
1915 (inputs `(("cairo" ,cairo)
1916 ("scdoc" ,scdoc)
1917 ("wayland" ,wayland)
1918 ("wayland-protocols" ,wayland-protocols)))
1919 (home-page "https://github.com/emersion/slurp")
1920 (synopsis "Select a region in a Wayland compositor")
1921 (description "Slurp can select a region in a Wayland compositor and print it
1922 to the standard output. It works well together with grim.")
1923 ;; MIT license.
1924 (license license:expat)))
1925
1926 (define-public sng
1927 (package
1928 (name "sng")
1929 (version "1.1.0")
1930 (source
1931 (origin
1932 (method url-fetch)
1933 (uri (string-append "mirror://sourceforge/sng/sng-"
1934 version ".tar.gz"))
1935 (sha256
1936 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1937 (build-system gnu-build-system)
1938 (arguments
1939 `(#:phases
1940 (modify-phases %standard-phases
1941 (add-before 'check 'link-pngsuite
1942 ;; tests expect pngsuite in source dir
1943 (lambda* (#:key inputs #:allow-other-keys)
1944 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1945 #t)))
1946 #:configure-flags
1947 (list (string-append "--with-rgbtxt="
1948 (assoc-ref %build-inputs "xorg-rgb")
1949 "/share/X11/rgb.txt"))))
1950 (inputs `(("xorg-rgb" ,xorg-rgb)
1951 ("libpng" ,libpng)))
1952 (native-inputs `(("pngsuite" ,pngsuite)))
1953 (home-page "http://sng.sourceforge.net")
1954 (synopsis "Markup language for representing PNG contents")
1955 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
1956 specifically to represent the entire contents of a PNG (Portable Network
1957 Graphics) file in an editable form. Thus, SNGs representing elaborate
1958 graphics images and ancillary chunk data can be readily generated or modified
1959 using only text tools.
1960
1961 SNG is implemented by a compiler/decompiler called sng that
1962 losslessly translates between SNG and PNG.")
1963 (license license:zlib)))
1964
1965 (define-public lodepng
1966 ;; There are no tags in the repository, so we take the version as defined in
1967 ;; lodepng.cpp.
1968 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
1969 (revision "1")
1970 (version "20200215"))
1971 (package
1972 (name "lodepng")
1973 (version (git-version version revision commit))
1974 (source (origin
1975 (method git-fetch)
1976 (uri (git-reference
1977 (url "https://github.com/lvandeve/lodepng")
1978 (commit commit)))
1979 (sha256
1980 (base32
1981 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
1982 (file-name (git-file-name name version))))
1983 (build-system gnu-build-system)
1984 (arguments
1985 '(#:phases
1986 (modify-phases %standard-phases
1987 (delete 'configure)
1988 (replace 'build
1989 (lambda _
1990 (setenv "CXXFLAGS" "-fPIC")
1991 (invoke "make" "lodepng.o")
1992 (invoke "make" "lodepng_util.o")
1993 (invoke "g++" "-fPIC" "-O3"
1994 "-o" "liblodepng.so"
1995 "-shared" "lodepng.o" "lodepng_util.o")
1996 #t))
1997 (replace 'check
1998 (lambda _
1999 (invoke "make" "unittest")
2000 (invoke "./unittest")
2001 #t))
2002 (replace 'install
2003 (lambda* (#:key outputs #:allow-other-keys)
2004 (let* ((out (assoc-ref outputs "out"))
2005 (doc (string-append out "/share/doc"))
2006 (lib (string-append out "/lib"))
2007 (include (string-append out "/include")))
2008 (install-file "lodepng.h" include)
2009 (install-file "lodepng_util.h" include)
2010 (install-file "liblodepng.so" lib)
2011 (install-file "README.md" doc)
2012 #t))))))
2013 (home-page "https://lodev.org/lodepng/")
2014 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2015 (description "LodePNG is a PNG image decoder and encoder, all in one,
2016 no dependency or linkage required. It's made for C (ISO C90), and has a C++
2017 wrapper with a more convenient interface on top.")
2018 (license license:zlib))))
2019
2020 (define-public icoutils
2021 (package
2022 (name "icoutils")
2023 (version "0.32.3")
2024 (source
2025 (origin
2026 (method url-fetch)
2027 (uri (string-append
2028 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2029 (sha256
2030 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2031 (build-system gnu-build-system)
2032 (inputs
2033 `(("libpng" ,libpng)
2034 ("perl" ,perl)))
2035 (propagated-inputs
2036 `(("perl-libwww" ,perl-libwww)))
2037 (home-page "https://www.nongnu.org/icoutils/")
2038 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2039 (description "Icoutils are a set of program for extracting and converting
2040 bitmaps from Microsoft Windows icon and cursor files. These files usually
2041 have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2042 in executables and libraries (@code{.dll}-files). (Such embedded files are
2043 referred to as resources.)
2044
2045 Conversion of these files to and from PNG images is done @command{icotool}.
2046 @command{extresso} automates these tasks with the help of special resource
2047 scripts. Resources such can be extracted from MS Windows executable and
2048 library files with @command{wrestool}.
2049
2050 This package can be used to create @code{favicon.ico} files for web sites.")
2051 (license license:gpl3+)))
2052
2053 (define-public libavif
2054 (package
2055 (name "libavif")
2056 (version "0.7.3")
2057 (source (origin
2058 (method git-fetch)
2059 (uri (git-reference
2060 (url "https://github.com/AOMediaCodec/libavif")
2061 (commit (string-append "v" version))))
2062 (file-name (git-file-name name version))
2063 (sha256
2064 (base32
2065 "17hagdngpc4xzrr0aa48nx399y5lawyyx9cpcdhpds1mqk6p77lp"))))
2066 (build-system cmake-build-system)
2067 (arguments
2068 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
2069 "-DAVIF_CODEC_RAV1E=OFF" ; not packaged yet
2070 "-DAVIF_BUILD_TESTS=ON")
2071 #:phases
2072 (modify-phases %standard-phases
2073 (replace 'check
2074 (lambda _
2075 (invoke "./aviftest" "../source/tests/data")))
2076 (add-after 'install 'install-readme
2077 (lambda* (#:key outputs #:allow-other-keys)
2078 (let* ((out (assoc-ref outputs "out"))
2079 (doc (string-append out "/share/doc/libavif-" ,version)))
2080 (install-file "../source/README.md" doc)
2081 #t))))))
2082 (inputs
2083 `(("libaom" ,libaom)
2084 ("dav1d" ,dav1d)))
2085 (synopsis "Encode and decode AVIF files")
2086 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
2087 File Format}. It can encode and decode all YUV formats and bit depths supported
2088 by AOM, including with alpha.")
2089 (home-page "https://github.com/AOMediaCodec/libavif")
2090 (license (list license:bsd-2 ; libavif itself
2091 license:expat)))) ; cJSON in the test suite
2092
2093 (define-public mtpaint
2094 (package
2095 (name "mtpaint")
2096 ;; The author neither releases tarballs nor uses git version tags.
2097 ;; Instead, author puts version in git commit title.
2098 (version "3.49.27")
2099 (source
2100 (origin
2101 (method git-fetch)
2102 (uri (git-reference
2103 (url "https://github.com/wjaguar/mtPaint")
2104 (commit "26751cd0336414e2f16cbe25c9fe2702f34e7b5c")))
2105 (file-name (git-file-name name version))
2106 (sha256
2107 (base32 "12mzai9pqvyb342m21rjz0jxiy75q24sjw6ax147pzy8frzkgd54"))))
2108 (build-system gnu-build-system)
2109 (native-inputs
2110 `(("gettext" ,gettext-minimal)
2111 ("pkg-config" ,pkg-config)
2112 ("which" ,which)))
2113 (inputs
2114 `(("imlib2" ,imlib2)
2115 ("libtiff" ,libtiff)
2116 ("libpng" ,libpng)
2117 ("libungif", libungif)
2118 ("libjpeg", libjpeg-turbo)
2119 ("libwebp" ,libwebp)
2120 ("openjpeg" ,openjpeg)
2121 ("lcms" ,lcms)
2122 ("zlib", zlib)
2123 ("glib" ,glib)
2124 ;; Support for gtk3 is in the testing stage.
2125 ("gtk+" ,gtk+-2)))
2126 (arguments
2127 `(#:configure-flags
2128 (list "intl" ; build internationalized version
2129 "man") ; build the man page
2130 #:tests? #f)) ; no test suite
2131 (home-page "http://mtpaint.sourceforge.net/")
2132 (synopsis "Create pixel art and manipulate digital images")
2133 (description
2134 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2135 It can create and edit indexed palette or 24bit RGB images, offers basic
2136 painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2137 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2138 (license license:gpl3+)))
2139
2140 (define-public phockup
2141 (package
2142 (name "phockup")
2143 (version "1.5.9")
2144 (source
2145 (origin
2146 (method git-fetch)
2147 (uri (git-reference
2148 (url "https://github.com/ivandokov/phockup")
2149 (commit version)))
2150 (file-name (git-file-name name version))
2151 (sha256
2152 (base32
2153 "13ajj0xch7yfqaaxbw0awxs0fz17n1rxir4gqh2wcgxjysqk1j2y"))))
2154 (build-system copy-build-system)
2155 (arguments
2156 `(#:install-plan '(("src" "share/phockup/")
2157 ("phockup.py" "share/phockup/"))
2158 #:phases
2159 (modify-phases %standard-phases
2160 (add-after 'unpack 'configure
2161 (lambda* (#:key inputs #:allow-other-keys)
2162 (substitute* (list "src/dependency.py" "src/exif.py")
2163 (("exiftool")
2164 (string-append (assoc-ref inputs "perl-image-exiftool")
2165 "/bin/exiftool")))
2166 #t))
2167 (add-before 'install 'check
2168 (lambda _
2169 (invoke "pytest")))
2170 (add-after 'install 'install-bin
2171 (lambda* (#:key outputs #:allow-other-keys)
2172 (let ((out (assoc-ref outputs "out")))
2173 (mkdir (string-append out "/bin"))
2174 (symlink (string-append out "/share/phockup/phockup.py")
2175 (string-append out "/bin/phockup")))
2176 #t)))))
2177 (inputs
2178 `(("perl-image-exiftool" ,perl-image-exiftool)
2179 ("python" ,python)))
2180 (native-inputs
2181 `(("python-pytest" ,python-pytest)
2182 ("python-pytest-mock" ,python-pytest-mock)))
2183 (home-page "https://github.com/ivandokov/phockup")
2184 (synopsis "Organize photos and videos in folders")
2185 (description "Phockup is a media sorting tool that uses creation date and
2186 time information in photos and videos to organize them into folders by year,
2187 month and day. All files which are not images or videos or those which do not
2188 have creation date information will be placed in a folder called
2189 @file{unknown}.")
2190 (license license:expat)))