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