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