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