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