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