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