gnu: ruby-pandoc-ruby: Use pandoc instead of ghc-pandoc.
[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 96
c42526e9
RG
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
123quality. It implements many popular algorithms, such as MS-SSIM, MS-SSIM*,
124SIMM, MSE, and PSNR. It is designed to be fast, accurate, and reliable. All
125code is Valgrind-clean and unit tested.")
126 (home-page "https://sourceforge.net/projects/iqa/")
127 (license license:bsd-4)))
128
e55354b8
DT
129(define-public libpng
130 (package
131 (name "libpng")
8b5b3aca 132 (version "1.6.37")
e55354b8
DT
133 (source (origin
134 (method url-fetch)
a2f3c614 135 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
21ef9843
MW
136 version "/libpng-" version ".tar.xz")
137 (string-append
138 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
913059a1
EF
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")))
e55354b8 143 (sha256
8fda37bc 144 (base32
8b5b3aca 145 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
e55354b8 146 (build-system gnu-build-system)
420b0137
MB
147 (arguments
148 `(#:configure-flags '("--disable-static")))
e55354b8
DT
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
35b9e423 156library. It supports almost all PNG features and is extensible.")
e55354b8
DT
157 (license license:zlib)
158 (home-page "http://www.libpng.org/pub/png/libpng.html")))
159
e0958c2d 160;; libpng-apng should be updated when the APNG patch is released:
161;; <https://bugs.gnu.org/27556>
114a325e 162(define-public libpng-apng
163 (package
114a325e 164 (name "libpng-apng")
e0958c2d 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)
114a325e 181 (arguments
696f1d0f
LF
182 `(#:modules ((guix build gnu-build-system)
183 (guix build utils)
184 (srfi srfi-1))
185 #:phases
114a325e 186 (modify-phases %standard-phases
187 (add-after 'unpack 'patch-apng
188 (lambda* (#:key inputs #:allow-other-keys)
189 (define (apply-patch file)
fccacffb
MW
190 (invoke "patch" "-p1" "--force"
191 "--input" file))
114a325e 192 (let ((apng.gz (assoc-ref inputs "apng")))
193 (format #t "Applying APNG patch '~a'...~%"
194 apng.gz)
fccacffb
MW
195 (invoke "sh" "-c"
196 (string-append "gunzip < " apng.gz " > the-patch"))
197 (apply-patch "the-patch")
198 #t)))
114a325e 199 (add-before 'configure 'no-checks
200 (lambda _
201 (substitute* "Makefile.in"
202 (("^scripts/symbols.chk") "")
203 (("check: scripts/symbols.chk") ""))
114a325e 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
e0958c2d 213 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
114a325e 214 (native-inputs
215 `(("libtool" ,libtool)))
e0958c2d 216 ;; libpng.la says "-lz", so propagate it.
217 (propagated-inputs
218 `(("zlib" ,zlib)))
114a325e 219 (synopsis "APNG patch for libpng")
220 (description
221 "APNG (Animated Portable Network Graphics) is an unofficial
222extension of the APNG (Portable Network Graphics) format.
223APNG patch provides APNG support to libpng.")
e0958c2d 224 (home-page "https://sourceforge.net/projects/libpng-apng/")
225 (license license:zlib)))
114a325e 226
2df831a7
RW
227(define-public libpng-1.2
228 (package
229 (inherit libpng)
6cdd8c97 230 (version "1.2.59")
2df831a7
RW
231 (source
232 (origin
233 (method url-fetch)
2df831a7
RW
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"
913059a1
EF
238 "/libpng12/libpng-" version ".tar.xz")
239 (string-append
240 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
2df831a7
RW
241 "/libpng12/libpng-" version ".tar.xz")))
242 (sha256
6cdd8c97
LF
243 (base32
244 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
2df831a7 245
1ee13e01 246(define-public pngcrush
2f8b9c46 247 (package
1ee13e01 248 (name "pngcrush")
249 (version "1.8.13")
2f8b9c46
HG
250 (source (origin
251 (method url-fetch)
252 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
1ee13e01 253 version "/pngcrush-" version "-nolib.tar.xz"))
2f8b9c46 254 (sha256 (base32
1ee13e01 255 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
2f8b9c46
HG
256 (build-system gnu-build-system)
257 (arguments
1ee13e01 258 '(#:tests? #f ; no check target
2f8b9c46
HG
259 #:phases
260 (modify-phases %standard-phases
261 (replace 'configure
262 (lambda* (#:key inputs outputs #:allow-other-keys)
1ee13e01 263 (substitute* "Makefile"
2f8b9c46
HG
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/")
fccacffb
MW
270 (string-append (assoc-ref outputs "out") "/")))
271 #t)))))
2f8b9c46
HG
272 (inputs
273 `(("libpng" ,libpng)
274 ("zlib" , zlib)))
1ee13e01 275 (home-page "https://pmt.sourceforge.io/pngcrush")
2f8b9c46 276 (synopsis "Utility to compress PNG files")
85a4531f
AB
277 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
278images. It can further losslessly compress them by as much as 40%.")
2f8b9c46
HG
279 (license license:zlib)))
280
6e35bad0
AV
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.
333Currently all documentation resides in @file{pnglite.h}.")
334 (license license:zlib))))
335
8db1bd18
HG
336(define-public libimagequant
337 (package
338 (name "libimagequant")
ba362ec8 339 (version "2.12.5")
8db1bd18
HG
340 (source
341 (origin
342 (method git-fetch)
343 (uri (git-reference
b0e7b699 344 (url "https://github.com/ImageOptim/libimagequant")
8db1bd18
HG
345 (commit version)))
346 (file-name (git-file-name name version))
347 (sha256
ba362ec8 348 (base32 "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k"))))
8db1bd18
HG
349 (build-system gnu-build-system)
350 (arguments
ba362ec8 351 '(#:tests? #f)) ; no check target
8db1bd18
HG
352 (home-page "https://pngquant.org/lib/")
353 (synopsis "Image palette quantization library")
354 (description "libimagequant is a small, portable C library for
355high-quality conversion of RGBA images to 8-bit indexed-color (palette)
356images. This library can significantly reduces file sizes and powers pngquant
357and other PNG optimizers.")
ba362ec8 358 (license license:gpl3+)))
8db1bd18 359
6b61dea3
HG
360(define-public pngquant
361 (package
362 (name "pngquant")
3caef3bd 363 (version "2.12.6")
6b61dea3
HG
364 (source
365 (origin
366 (method git-fetch)
367 (uri (git-reference
b0e7b699 368 (url "https://github.com/kornelski/pngquant")
6b61dea3
HG
369 (commit version)))
370 (file-name (git-file-name name version))
371 (sha256
3caef3bd 372 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
6b61dea3
HG
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
388sizes by converting images to a more efficient 8-bit PNG format with alpha
389channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
390are fully standards-compliant and are supported by all web browsers and
391operating systems.
392
393Features:
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
a1552f52 404(define-public ijg-libjpeg
e55354b8
DT
405 (package
406 (name "libjpeg")
3883fad2 407 (version "9d")
e55354b8
DT
408 (source (origin
409 (method url-fetch)
60562ec2 410 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
e55354b8
DT
411 version ".tar.gz"))
412 (sha256 (base32
3883fad2 413 "0clwys9lcqlxqgcw8s1gwfm5ix2zjlqpklmd3mbvqmj5ibj51jwr"))))
e55354b8 414 (build-system gnu-build-system)
35b9e423 415 (synopsis "Library for handling JPEG files")
e55354b8
DT
416 (description
417 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
418JPEG is a standardized compression method for full-color and gray-scale
419images.
61853b74
MC
420It also includes programs that provide conversion between the JPEG format and
421image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
422lossless 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")
e55354b8 430 (license license:ijg)
60562ec2 431 (home-page "https://www.ijg.org/")))
e55354b8 432
b81245cc
KK
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)
8b9570ad
KK
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)))))
b81245cc
KK
510 (synopsis "Implementation of the JPEG XR standard")
511 (description "JPEG XR is an approved ISO/IEC International standard (its
512official 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
fcc43c1f
AB
519(define-public jpegoptim
520 (package
521 (name "jpegoptim")
b01a8790 522 (version "1.4.6")
fcc43c1f
AB
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
b01a8790 528 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
fcc43c1f 529 (build-system gnu-build-system)
4bd428a7 530 (inputs `(("libjpeg" ,libjpeg-turbo)))
fcc43c1f 531 (arguments
b01a8790 532 '(#:tests? #f)) ; no tests
fcc43c1f
AB
533 (synopsis "Optimize JPEG images")
534 (description
535 "jpegoptim provides lossless optimization (based on optimizing
536the Huffman tables) and \"lossy\" optimization based on setting
537maximum quality factor.")
538 (license license:gpl2+)
ada3b94f 539 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
e55354b8 540
f5e4229a
BT
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
563type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
564convert between PNG and ICNS. @command{icns2png} will extract image files from
565ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
566with .desktop files. Additionally, @command{icontainer2png} is provided for
567extracting icontainer icon files.")
568 (license (list license:lgpl2.1+ ; libicns
569 license:lgpl2.0+ ; src/apidocs.*
570 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
571
e55354b8
DT
572(define-public libtiff
573 (package
574 (name "libtiff")
d9cd568a 575 (version "4.1.0")
c8eb2b8c
LF
576 (source
577 (origin
578 (method url-fetch)
8a35ffd8 579 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
c8eb2b8c 580 version ".tar.gz"))
c8eb2b8c
LF
581 (sha256
582 (base32
d9cd568a 583 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
e55354b8 584 (build-system gnu-build-system)
6f6eb857
LC
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/"
2874a33d
MB
592 ,name "-" ,version)
593 "--disable-static")))
e55354b8 594 (inputs `(("zlib" ,zlib)
4bd428a7 595 ("libjpeg" ,libjpeg-turbo)))
35b9e423 596 (synopsis "Library for handling TIFF files")
e55354b8
DT
597 (description
598 "Libtiff provides support for the Tag Image File Format (TIFF), a format
599used for storing image data.
600Included are a library, libtiff, for reading and writing TIFF and a small
601collection of tools for doing simple manipulations of TIFF images.")
166191b3
LC
602 (license (license:non-copyleft "file://COPYRIGHT"
603 "See COPYRIGHT in the distribution."))
0bd1097c 604 (home-page "http://www.simplesystems.org/libtiff/")))
ed5940b6 605
894e2cba
TUBK
606(define-public leptonica
607 (package
608 (name "leptonica")
340502ba 609 (version "1.74.4")
894e2cba
TUBK
610 (source
611 (origin
69f7d3f4
RW
612 (method git-fetch)
613 (uri (git-reference
b0e7b699 614 (url "https://github.com/DanBloomberg/leptonica")
69f7d3f4
RW
615 (commit version)))
616 (file-name (git-file-name name version))
894e2cba 617 (sha256
69f7d3f4 618 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
894e2cba
TUBK
619 (build-system gnu-build-system)
620 (native-inputs
d02fb7ce
TUBK
621 `(("gnuplot" ,gnuplot) ;needed for test suite
622 ("autoconf" ,autoconf)
623 ("automake" ,automake)
624 ("libtool" ,libtool)
625 ("pkg-config" ,pkg-config)))
894e2cba
TUBK
626 (inputs
627 `(("giflib" ,giflib)
4bd428a7 628 ("libjpeg" ,libjpeg-turbo)
894e2cba
TUBK
629 ("libpng" ,libpng)
630 ("libtiff" ,libtiff)
1c60bd32
MB
631 ("libwebp" ,libwebp)
632 ("openjpeg" ,openjpeg)
894e2cba
TUBK
633 ("zlib" ,zlib)))
634 (arguments
d02fb7ce 635 '(#:phases
894e2cba 636 (modify-phases %standard-phases
d02fb7ce
TUBK
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")
fccacffb 643 "true"))
08dfff74
MB
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))))))
894e2cba
TUBK
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
658image processing and image analysis operations. It supports rasterop, affine
659transformations, binary and grayscale morphology, rank order, and convolution,
660seedfill and connected components, image transformations combining changes in
661scale and pixel depth, and pixelwise masking, blending, enhancement, and
662arithmetic ops.")
663 (license license:bsd-2)))
664
8d9872b5
MB
665(define-public jbig2dec
666 (package
667 (name "jbig2dec")
3fd74c45 668 (version "0.18")
fb94354a
MB
669 (source (origin
670 (method url-fetch)
671 (uri (string-append "https://github.com/ArtifexSoftware"
672 "/ghostpdl-downloads/releases/download"
3fd74c45 673 "/gs951/" name "-" version ".tar.gz"))
fb94354a
MB
674 (sha256
675 (base32
3fd74c45 676 "0pigfw2v0ppvr0lbysm69gx0zsa5q2q92yrb8af2j3im6x97f6cy"))))
8d9872b5 677 (build-system gnu-build-system)
3fd74c45
MB
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
8d9872b5
MB
695 (synopsis "Decoder of the JBIG2 image compression format")
696 (description
36a4366d 697 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
7c125ce0
AK
698monochrome) images at moderately high resolution, and in particular scanned
699paper documents. In this domain it is very efficient, offering compression
700ratios on the order of 100:1.
8d9872b5
MB
701
702This is a decoder only implementation, and currently is in the alpha
703stage, meaning it doesn't completely work yet. However, it is
704maintaining parity with available encoders, so it is useful for real
705work.")
6acc671b 706 (home-page "https://jbig2dec.com")
8d9872b5 707 (license license:gpl2+)))
38c55e5c 708
8f685df2
TGR
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
768ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
769black-and-white scanned documents. It is widely used in fax products, printer
770firmware and drivers, document management systems, and imaging software.
771
772This package provides a static C library of (de)compression functions and some
773simple command-line converters similar to those provided by netpbm.
774
775Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
776options of the standard but has to keep the full uncompressed image in memory.
777The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
778memory management optimized for embedded and fax applications. It buffers
779only a few lines of the uncompressed image in memory and is able to stream
780images of initially unknown height.")
781 (license (list license:isc ; pbmtools/p?m.5
782 license:gpl2+)))) ; the rest
783
3f03bd37
RG
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
801test suite, including conformance tests (following Rec. ITU-T T.803 | ISO/IEC
80215444-4 procedures), non-regression tests and unit tests.")
803 (home-page "https://github.com/uclouvain/openjpeg-data")
804 (license license:bsd-2)))
805
38c55e5c
MB
806(define-public openjpeg
807 (package
808 (name "openjpeg")
de1b5e49
MB
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"))))
38c55e5c
MB
819 (build-system cmake-build-system)
820 (arguments
8de1979d
MB
821 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
822 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
38c55e5c
MB
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
831been developed in order to promote the use of JPEG 2000, the new
832still-image compression standard from the Joint Photographic Experts
833Group (JPEG).
834
835In addition to the basic codec, various other features are under
836development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
837an indexing tool useful for the JPIP protocol, JPWL-tools for
838error-resilience, a Java-viewer for j2k-images, ...")
b9270582 839 (home-page "https://github.com/uclouvain/openjpeg")
38c55e5c 840 (license license:bsd-2)))
76d88cfa 841
6140b9d8
RW
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
de67e922
LF
850 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
851 name "-" version ".tar.gz"))
6140b9d8
RW
852 (sha256
853 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
854
e596ab0f
AK
855(define-public giflib
856 (package
857 (name "giflib")
c9d4e14a 858 (version "5.2.1")
e596ab0f
AK
859 (source (origin
860 (method url-fetch)
861 (uri (string-append "mirror://sourceforge/giflib/giflib-"
c9d4e14a 862 version ".tar.gz"))
e596ab0f 863 (sha256
44c5f025 864 (base32
c9d4e14a 865 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
e596ab0f
AK
866 (build-system gnu-build-system)
867 (outputs '("bin" ; utility programs
868 "out")) ; library
e596ab0f 869 (arguments
c9d4e14a
MB
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
44c5f025
EF
876 (modify-phases %standard-phases
877 (add-after 'unpack 'disable-html-doc-gen
878 (lambda _
c9d4e14a 879 (substitute* "doc/Makefile"
4a3ee3fb
MW
880 (("^all: allhtml manpages") ""))
881 #t))
c9d4e14a 882 (delete 'configure)
44c5f025
EF
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))))
4a3ee3fb
MW
895 (find-files "doc" "\\.1"))
896 #t))))))
e596ab0f
AK
897 (synopsis "Tools and library for working with GIF images")
898 (description
35b9e423 899 "GIFLIB is a library for reading and writing GIF images. It is API and
e596ab0f
AK
900ABI compatible with libungif which was in wide use while the LZW compression
901algorithm was patented. Tools are also included to convert, manipulate,
902compose, and analyze GIF images.")
903 (home-page "http://giflib.sourceforge.net/")
904 (license license:x11)))
905
3f1f98d9
MC
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
86a03090
TGR
951reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
952Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
3f1f98d9
MC
953 (license license:gpl2+)))
954
0731a47c
TUBK
955(define-public libungif
956 (package
957 (name "libungif")
958 (version "4.1.4")
959 (source (origin
960 (method url-fetch)
de67e922
LF
961 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
962 "libungif-" version "/libungif-"
0731a47c
TUBK
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
76d88cfa
AK
975(define-public imlib2
976 (package
977 (name "imlib2")
c45fdf90 978 (version "1.6.1")
76d88cfa
AK
979 (source (origin
980 (method url-fetch)
981 (uri (string-append
de67e922
LF
982 "mirror://sourceforge/enlightenment/imlib2-src/" version
983 "/imlib2-" version ".tar.bz2"))
76d88cfa
AK
984 (sha256
985 (base32
c45fdf90 986 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
76d88cfa 987 (build-system gnu-build-system)
76d88cfa
AK
988 (native-inputs
989 `(("pkgconfig" ,pkg-config)))
990 (inputs
e56d02a0 991 `(("bzip2" ,bzip2)
76d88cfa 992 ("freetype" ,freetype)
e56d02a0
EF
993 ("giflib" ,giflib)
994 ("libid3tag" ,libid3tag)
4bd428a7 995 ("libjpeg" ,libjpeg-turbo)
76d88cfa
AK
996 ("libpng" ,libpng)
997 ("libtiff" ,libtiff)
e56d02a0
EF
998 ("libx11" ,libx11)
999 ("libxext" ,libxext)
1000 ("libwebp" ,libwebp)))
3b3b60d0 1001 (home-page "https://sourceforge.net/projects/enlightenment/")
76d88cfa
AK
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
1006rendering, manipulation, arbitrary polygon support, etc.
1007
1008It does ALL of these operations FAST. Imlib2 also tries to be highly
1009intelligent about doing them, so writing naive programs can be done easily,
1010without sacrificing speed.
1011
1012This is a complete rewrite over the Imlib 1.x series. The architecture is
1013more modular, simple, and flexible.")
8835aed4 1014 (license license:imlib2)))
f7d28082
AK
1015
1016(define-public giblib
1017 (package
1018 (name "giblib")
1019 (version "1.2.4")
1020 (source (origin
1021 (method url-fetch)
bf512da1
EF
1022 (uri (list
1023 (string-append
1024 "http://linuxbrit.co.uk/downloads/giblib-"
1025 version ".tar.gz")
1026 (string-append
1a045954
TGR
1027 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
1028 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
1029 version ".tar.gz")
bf512da1
EF
1030 (string-append
1031 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
1032 "files/giblib/giblib-" version ".tar.gz")))
f7d28082
AK
1033 (sha256
1034 (base32
1035 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
1036 (build-system gnu-build-system)
1037 (inputs
1038 `(("libx11" ,libx11)
1039 ("imlib2" ,imlib2)))
30e8cf5f
TGR
1040 (home-page
1041 ;; This vanished page is universally accepted as giblib's home despite not
1042 ;; mentioning the package once.
7077ac80 1043 (string-append "https://web.archive.org/web/20140907071208/"
30e8cf5f 1044 "https://linuxbrit.co.uk/software/"))
f7d28082
AK
1045 (synopsis "Wrapper library for imlib2")
1046 (description
35b9e423 1047 "Giblib is a simple library which wraps imlib2's context API, avoiding
f7d28082
AK
1048all the context_get/set calls, adds fontstyles to the truetype renderer and
1049supplies 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."))))
43402c5c
DT
1054
1055(define-public freeimage
1056 (package
1057 (name "freeimage")
8dc3c2a7 1058 (version "3.18.0")
43402c5c
DT
1059 (source (origin
1060 (method url-fetch)
1061 (uri (string-append
1062 "mirror://sourceforge/freeimage/Source%20Distribution/"
1063 version "/FreeImage"
bcc09d9a 1064 (string-concatenate (string-split version #\.))
43402c5c
DT
1065 ".zip"))
1066 (sha256
1067 (base32
8dc3c2a7 1068 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
a5d4c96b
EF
1069 (modules '((guix build utils)))
1070 (snippet
1071 '(begin
1072 (for-each
1073 (lambda (dir)
1074 (delete-file-recursively (string-append "Source/" dir)))
f347c24a 1075 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
8dc3c2a7 1076 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
271f2786
MB
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"))))))))
43402c5c
DT
1090 (build-system gnu-build-system)
1091 (arguments
4a2798e0
EF
1092 '(#:phases
1093 (modify-phases %standard-phases
a5d4c96b
EF
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")))
4a2798e0
EF
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)))
a5d4c96b
EF
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 "
0fe041bd 1120 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
43402c5c
DT
1121 #:tests? #f)) ; no check target
1122 (native-inputs
a5d4c96b
EF
1123 `(("pkg-config" ,pkg-config)
1124 ("unzip" ,unzip)))
1125 (inputs
4bd428a7 1126 `(("libjpeg" ,libjpeg-turbo)
8dc3c2a7 1127 ("libjxr" ,libjxr)
a5d4c96b
EF
1128 ("libpng" ,libpng)
1129 ("libraw" ,libraw)
1130 ("libtiff" ,libtiff)
1131 ("libwebp" ,libwebp)
1132 ("openexr" ,openexr)
1133 ("openjpeg" ,openjpeg)
1134 ("zlib" ,zlib)))
43402c5c
DT
1135 (synopsis "Library for handling popular graphics image formats")
1136 (description
1137 "FreeImage is a library for developers who would like to support popular
1138graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1139 (license license:gpl2+)
1140 (home-page "http://freeimage.sourceforge.net")))
97039f6e
AE
1141
1142(define-public vigra
019b3875
AE
1143 (package
1144 (name "vigra")
83273596 1145 (version "1.11.1")
019b3875
AE
1146 (source
1147 (origin
1148 (method url-fetch)
1149 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
83273596
MB
1150 "Version-" (string-join (string-split version #\.) "-")
1151 "/vigra-" version "-src.tar.gz"))
a82e6faa 1152 (patches (search-patches "vigra-python-compat.patch"))
019b3875 1153 (sha256 (base32
83273596 1154 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
019b3875
AE
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
4bd428a7 1163 ("libjpeg" ,libjpeg-turbo)
019b3875
AE
1164 ("libpng" ,libpng)
1165 ("libtiff" ,libtiff)
1166 ("openexr" ,openexr)
691068f0 1167 ("python" ,python-wrapper)
a82e6faa 1168 ("python-numpy" ,python-numpy)
019b3875
AE
1169 ("zlib" ,zlib)))
1170 (native-inputs
1171 `(("doxygen" ,doxygen)
a82e6faa 1172 ("python-nose" ,python-nose)
556530c9 1173 ("sphinx" ,python-sphinx)))
019b3875
AE
1174 (arguments
1175 `(#:test-target "check"
e32db0fa
RW
1176 #:phases
1177 (modify-phases %standard-phases
43696990 1178 (add-after 'unpack 'disable-broken-tests
e32db0fa 1179 (lambda _
43696990 1180 ;; See https://github.com/ukoethe/vigra/issues/432
e32db0fa
RW
1181 (substitute* "test/fourier/CMakeLists.txt"
1182 (("VIGRA_ADD_TEST.*") ""))
43696990
MB
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") ""))
e32db0fa 1187 #t)))
019b3875
AE
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")
a82e6faa
MB
1192 "/lib/python"
1193 ,(version-major+minor (package-version python))
1194 "/site-packages")
019b3875
AE
1195 ;; OpenEXR is not enabled by default.
1196 "-DWITH_OPENEXR=1"
f803f775
LF
1197 ;; Fix rounding error on 32-bit machines
1198 "-DCMAKE_C_FLAGS=-ffloat-store"
019b3875
AE
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")
f803f775
LF
1204 "/include/OpenEXR"
1205 " -ffloat-store"))))
019b3875
AE
1206 (synopsis "Computer vision library")
1207 (description
1208 "VIGRA stands for Vision with Generic Algorithms. It is an image
97039f6e
AE
1209processing and analysis library that puts its main emphasis on customizable
1210algorithms and data structures. It is particularly strong for
1211multi-dimensional image processing.")
019b3875 1212 (license license:expat)
83273596 1213 (home-page "https://ukoethe.github.io/vigra/")))
060ad3de 1214
62813c10 1215(define-public vigra-c
4526bd07
RW
1216 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1217 (revision "1"))
62813c10
FT
1218 (package
1219 (name "vigra-c")
4526bd07 1220 (version (git-version "0.0.0" revision commit))
62813c10
FT
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
4526bd07 1229 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
62813c10
FT
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)
4526bd07 1239 ("hdf5" ,hdf5)
62813c10
FT
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
1244library. It is designed primarily to ease the implementation of higher-level
1245language bindings to VIGRA.")
1246 (license license:expat))))
1247
060ad3de
TUBK
1248(define-public libwebp
1249 (package
1250 (name "libwebp")
ad7287b2 1251 (version "1.1.0")
060ad3de
TUBK
1252 (source
1253 (origin
b981f777
MB
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))
060ad3de 1260 (sha256
b2ed5ca7 1261 (base32
ad7287b2 1262 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
060ad3de
TUBK
1263 (build-system gnu-build-system)
1264 (inputs
1265 `(("freeglut" ,freeglut)
1266 ("giflib" ,giflib)
4bd428a7 1267 ("libjpeg" ,libjpeg-turbo)
060ad3de
TUBK
1268 ("libpng" ,libpng)
1269 ("libtiff" ,libtiff)))
b981f777
MB
1270 (native-inputs
1271 `(("autoconf" ,autoconf)
1272 ("automake" ,automake)
1273 ("libtool" ,libtool)))
060ad3de
TUBK
1274 (arguments
1275 '(#:configure-flags '("--enable-libwebpmux"
1276 "--enable-libwebpdemux"
371d95eb
MB
1277 "--enable-libwebpdecoder"
1278 "--disable-static")))
060ad3de
TUBK
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
1eefe4a8
LC
1283for images. WebP lossless images are 26% smaller in size compared to
1284PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1285equivalent SSIM index. WebP supports lossless transparency (also known as
1286alpha channel) with just 22% additional bytes. Transparency is also supported
060ad3de
TUBK
1287with lossy compression and typically provides 3x smaller file sizes compared
1288to PNG when lossy compression is acceptable for the red/green/blue color
1289channels.")
1290 (license license:bsd-3)))
b9ecd5ae
SB
1291
1292(define-public libmng
1293 (package
1294 (name "libmng")
1295 (version "2.0.3")
1296 (source (origin
1297 (method url-fetch)
0f971a04
LF
1298 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1299 version "/" name "-" version ".tar.xz"))
b9ecd5ae
SB
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)
4bd428a7 1307 ("libjpeg" ,libjpeg-turbo)
b9ecd5ae 1308 ("zlib" ,zlib)))
ce91eeac 1309 (home-page "https://www.libmng.com/")
b9ecd5ae
SB
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)))
3aab2c83 1314
023f0fb0
AK
1315(define-public exiv2
1316 (package
1317 (name "exiv2")
630b75f7 1318 (version "0.27.3")
0e1c5ccc
TGR
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
630b75f7 1325 (base32 "0y77wfadjsrcxijdqgkr3q88b6mm9y3rg8kqsmaig8iah49md7x7"))))
0e1c5ccc
TGR
1326 (build-system cmake-build-system)
1327 (arguments '(#:tests? #f)) ; no test suite
023f0fb0
AK
1328 (propagated-inputs
1329 `(("expat" ,expat)
1330 ("zlib" ,zlib)))
993d8164 1331 (home-page "https://www.exiv2.org/")
023f0fb0
AK
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
1335metadata. It provides fast and easy read and write access to the Exif, IPTC
1336and 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
eafd0390
LC
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
3aab2c83
DT
1372(define-public devil
1373 (package
1374 (name "devil")
77ab6983 1375 (version "1.8.0")
3aab2c83
DT
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
77ab6983
MB
1382 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1383 (build-system cmake-build-system)
3aab2c83 1384 (arguments
77ab6983
MB
1385 '(;; XXX: Not supported in the released CMakeLists.txt.
1386 ;; Enable this for > 1.8.0.
1387 #:tests? #f
3aab2c83
DT
1388 #:phases
1389 (modify-phases %standard-phases
77ab6983
MB
1390 (add-before 'configure 'change-directory
1391 (lambda _ (chdir "DevIL") #t)))))
3aab2c83
DT
1392 (native-inputs
1393 `(("pkg-config" ,pkg-config)))
1394 (inputs
1395 `(("lcms" ,lcms)
77ab6983 1396 ("libjpeg" ,libjpeg-turbo)
3aab2c83
DT
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
1404applications with support for many types of images. DevIL can load, save,
1405convert, manipulate, filter and display a wide variety of image formats.")
1406 (home-page "http://openil.sourceforge.net")
1407 (license license:lgpl2.1+)))
b0b23e52
DT
1408
1409(define-public jasper
1410 (package
1411 (name "jasper")
1e58798b 1412 (version "2.0.20")
b0b23e52 1413 (source (origin
d57b017c
RW
1414 (method git-fetch)
1415 (uri (git-reference
b0e7b699 1416 (url "https://github.com/mdadams/jasper")
d57b017c
RW
1417 (commit (string-append "version-" version))))
1418 (file-name (git-file-name name version))
b0b23e52
DT
1419 (sha256
1420 (base32
1e58798b 1421 "1bn4mg6l5afryrlyk3y7p3accdq113fis8hpwywy5g51ycablz3h"))))
c7a70c33 1422 (build-system cmake-build-system)
1e58798b
TGR
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)))))
4bd428a7 1435 (inputs `(("libjpeg" ,libjpeg-turbo)))
b0b23e52
DT
1436 (synopsis "JPEG-2000 library")
1437 (description "The JasPer Project is an initiative to provide a reference
1438implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1439ISO/IEC 15444-1).")
1440 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1441 (license (license:x11-style "file://LICENSE"))))
365a4a7f
EF
1442
1443(define-public zimg
1444 (package
1445 (name "zimg")
fc103869 1446 (version "2.9.3")
365a4a7f
EF
1447 (source
1448 (origin
ba185e2a
RW
1449 (method git-fetch)
1450 (uri (git-reference
b0e7b699 1451 (url "https://github.com/sekrit-twc/zimg")
ba185e2a
RW
1452 (commit (string-append "release-" version))))
1453 (file-name (git-file-name name version))
365a4a7f 1454 (sha256
b08c4f5f 1455 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
365a4a7f
EF
1456 (build-system gnu-build-system)
1457 (native-inputs
1458 `(("autoconf" ,autoconf)
1459 ("automake" ,automake)
1460 ("libtool" ,libtool)))
365a4a7f
EF
1461 (synopsis "Scaling, colorspace conversion, and dithering library")
1462 (description "Zimg implements the commonly required image processing basics
1463of scaling, colorspace conversion, and depth conversion. A simple API enables
1464conversion between any supported formats to operate with minimal knowledge from
1465the programmer.")
1466 (home-page "https://github.com/sekrit-twc/zimg")
8ee04627 1467 ;; test/extra/ contains musl-libm,
365a4a7f 1468 ;; which is MIT/expat licensed, but only used for tests
f62e7ce4 1469 (license license:wtfpl2)))
af7aaaeb
TGR
1470
1471(define-public perceptualdiff
1472 (package
1473 (name "perceptualdiff")
1474 (version "1.3")
1475 (source
1476 (origin
be59c48d
TGR
1477 (method git-fetch)
1478 (uri (git-reference
b0e7b699 1479 (url "https://github.com/myint/perceptualdiff")
be59c48d
TGR
1480 (commit (string-append "v" version))))
1481 (file-name (git-file-name name version))
1482 (sha256
1483 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
af7aaaeb
TGR
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"
fccacffb
MW
1493 (("../build") "../../build"))
1494 #t)))))
af7aaaeb
TGR
1495 (home-page "https://github.com/myint/perceptualdiff")
1496 (synopsis "Perceptual image comparison utility")
1497 (description "PerceptualDiff visually compares two images to determine
1498whether they look alike. It uses a computational model of the human visual
1499system to detect similarities. This allows it too see beyond irrelevant
1500differences in file encoding, image quality, and other small variations.")
1501 (license license:gpl2+)))
1fa3e336
EB
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
7c90d0f4 1517 `(("gettext" ,gettext-minimal)
1fa3e336
EB
1518 ("libtool" ,libtool)
1519 ("perl" ,perl))) ;for tests
1520 (inputs
1521 `(("libmhash" ,libmhash)
1522 ("libmcrypt" ,libmcrypt)
4bd428a7 1523 ("libjpeg" ,libjpeg-turbo)
1fa3e336
EB
1524 ("zlib" ,zlib)))
1525 (arguments
a56bf101
LC
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)))))
1fa3e336
EB
1536 (home-page "http://steghide.sourceforge.net")
1537 (synopsis "Image and audio steganography")
1538 (description
7832785d
TGR
1539 "Steghide is a program to hide data in various kinds of image and audio
1540files (known as @dfn{steganography}). Neither color nor sample frequencies are
1541changed, making the embedding resistant against first-order statistical tests.")
1fa3e336 1542 (license license:gpl2+)))
ac2a38a5
RW
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
b0e7b699 1553 (url "https://github.com/extemporelang/stb")
ac2a38a5
RW
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
39162ee4
RW
1561 ;; Extempore refuses to build on architectures other than x86_64
1562 (supported-systems '("x86_64-linux"))
ac2a38a5
RW
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
1567all included libraries only the image loading and decoding library is
1568installed as @code{stb_image}.")
1569 (license license:public-domain))))
93117227
AI
1570
1571(define-public optipng
1572 (package
1573 (name "optipng")
bbf8832f 1574 (version "0.7.7")
93117227
AI
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
64ed4b6a
EF
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))))
93117227
AI
1589 (build-system gnu-build-system)
1590 (inputs
64ed4b6a
EF
1591 `(("libpng" ,libpng)
1592 ("zlib" ,zlib)))
93117227
AI
1593 (arguments
1594 '(#:phases
1595 (modify-phases %standard-phases
93117227
AI
1596 (replace 'configure
1597 (lambda* (#:key outputs #:allow-other-keys)
bbf8832f
TGR
1598 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1599 (invoke "sh" "configure"
64ed4b6a
EF
1600 (string-append "--prefix=" (assoc-ref outputs "out"))
1601 "-with-system-libs")
bbf8832f
TGR
1602 #t)))))
1603 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
93117227
AI
1604 (description "OptiPNG is a PNG optimizer that recompresses image
1605files to a smaller size, without losing any information. This program
1606also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1607PNG, and performs PNG integrity checks and corrections.")
1608 (home-page "http://optipng.sourceforge.net/")
1609 (license license:zlib)))
37e05d64 1610
68fea604
VC
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
1639applications like viewers, converters and editors. As far as that is
1640possible, all formats supported by the PNG standard are represented.")
1641 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1642use, copy, modify and distribute these images for any purpose and without fee
1643is hereby granted."))))
1644
37e05d64
TGR
1645(define-public libjpeg-turbo
1646 (package
1647 (name "libjpeg-turbo")
ceaf1805 1648 (version "2.0.4")
4fe1b2e6 1649 (replacement libjpeg-turbo/fixed)
37e05d64
TGR
1650 (source (origin
1651 (method url-fetch)
ec92d786
MB
1652 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1653 version "/libjpeg-turbo-" version ".tar.gz"))
37e05d64
TGR
1654 (sha256
1655 (base32
ceaf1805 1656 "01ill8bgjyk582wipx7sh7gj2nidylpbzvwhx0wkcm6mxx3qbp9k"))))
6871121b 1657 (build-system cmake-build-system)
37e05d64
TGR
1658 (native-inputs
1659 `(("nasm" ,nasm)))
1660 (arguments
ff5733d1 1661 `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
f3418f58 1662 "-DENABLE_STATIC=0"
2f823fb4
EF
1663 ;; djpeg-shared-3x2-float-prog-cmp fails on 32-bit PPC.
1664 ,@(if (string=? "powerpc-linux" (%current-system))
1665 `("-DFLOATTEST=NO")
1666 '())
f3418f58
MB
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"))
2f823fb4
EF
1680 ;; 32-bit and 64-bit
1681 ((string-prefix? "powerpc" target)
1682 `("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
f3418f58
MB
1683 (else '()))
1684 '())))
ff5733d1
MB
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.
7c1ea931 1689 `(#:cmake ,cmake-bootstrap))))
a77de47a 1690 (home-page "https://libjpeg-turbo.org/")
37e05d64
TGR
1691 (synopsis "SIMD-accelerated JPEG image handling library")
1692 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1693JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1694x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1695its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1696a significant amount.
1697libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1698but more straightforward TurboJPEG API, and provides a full-featured Java
1699interface. It supports color space extensions that allow it to compress from
1700and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
71de61c3
MB
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
21122bd7 1705
4fe1b2e6
MW
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
a1552f52 1718(define-deprecated libjpeg libjpeg-turbo)
3299d8ef 1719(export libjpeg)
a1552f52 1720
21122bd7
JD
1721(define-public niftilib
1722 (package
f729a4d8
RW
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
21122bd7
JD
1759files in the nifti-1 data format - a binary file format for storing
1760medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1761(fMRI) brain images.")
f729a4d8
RW
1762 (home-page "http://niftilib.sourceforge.net")
1763 (license license:public-domain)))
f2079849
JL
1764
1765(define-public gpick
1766 (package
1767 (name "gpick")
1768 (version "0.2.5")
1769 (source (origin
94be94cf
RW
1770 (method git-fetch)
1771 (uri (git-reference
b0e7b699 1772 (url "https://github.com/thezbyg/gpick")
94be94cf
RW
1773 (commit (string-append name "-" version))))
1774 (file-name (git-file-name name version))
f2079849
JL
1775 (sha256
1776 (base32
94be94cf 1777 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
2235abb2 1778 (build-system scons-build-system)
f2079849
JL
1779 (native-inputs
1780 `(("boost" ,boost)
f2d97d57 1781 ("gettext" ,gettext-minimal)
2235abb2 1782 ("pkg-config" ,pkg-config)))
f2079849
JL
1783 (inputs
1784 `(("expat" ,expat)
1785 ("gtk2" ,gtk+-2)
1786 ("lua" ,lua-5.2)))
1787 (arguments
1788 `(#:tests? #f
2235abb2
AI
1789 #:scons ,scons-python2
1790 #:scons-flags (list (string-append "DESTDIR=" %output))
f2079849
JL
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"))
2235abb2 1797 #t)))))
f2079849
JL
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)))
bc806b0c
LF
1802
1803(define-public libiptcdata
1804 (package
1805 (name "libiptcdata")
a42b6848 1806 (version "1.0.5")
bc806b0c
LF
1807 (source (origin
1808 (method url-fetch)
a42b6848
TGR
1809 (uri (string-append "https://github.com/ianw/libiptcdata"
1810 "/releases/download/release_"
1811 (string-join (string-split version #\.) "_")
1812 "/" name "-" version ".tar.gz"))
bc806b0c
LF
1813 (sha256
1814 (base32
a42b6848 1815 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
bc806b0c 1816 (build-system gnu-build-system)
a42b6848 1817 (home-page "https://github.com/ianw/libiptcdata")
bc806b0c 1818 (synopsis "IPTC metadata manipulation library")
a09a2119
TGR
1819 (description
1820 "Libiptcdata is a C library for manipulating the International Press
1821Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
bc806b0c
LF
1822such as images. This metadata can include captions and keywords, often used by
1823popular photo management applications. The library provides routines for
1824parsing, viewing, modifying, and saving this metadata.")
1825 (license license:lgpl2.0+)))
84567657
OP
1826
1827(define-public flameshot
1828 (package
1829 (name "flameshot")
1830 (version "0.5.1")
1831 (source
1832 (origin
743600e9
RW
1833 (method git-fetch)
1834 (uri (git-reference
b0e7b699 1835 (url "https://github.com/lupoDharkael/flameshot")
743600e9
RW
1836 (commit (string-append "v" version))))
1837 (file-name (git-file-name name version))
84567657
OP
1838 (sha256
1839 (base32
743600e9 1840 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
84567657
OP
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.
1859Features:
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+)))
da4dde61 1869
0d529a7c
PN
1870(define-public gifsicle
1871 (package
1872 (name "gifsicle")
5c46e1dd 1873 (version "1.92")
0d529a7c
PN
1874 (source
1875 (origin
1876 (method url-fetch)
645b6c7f 1877 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
0d529a7c
PN
1878 version ".tar.gz"))
1879 (sha256
5c46e1dd 1880 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
0d529a7c
PN
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)))))
5c46e1dd 1895 (native-inputs `(("perl" ,perl))) ; only for tests
0d529a7c 1896 (inputs `(("libx11" ,libx11)))
645b6c7f 1897 (home-page "https://www.lcdf.org/gifsicle/")
0d529a7c
PN
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
1906tables, 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
1911Two other programs are included with Gifsicle: @command{gifview} is a
1912lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1913identical visual appearance.")
1914 (license license:gpl2+)))
3239dcd3 1915
dc7e5783 1916;; 1.0.7 is buggy and reverted in git repository.
3239dcd3
PAR
1917(define-public jp2a
1918 (package
1919 (name "jp2a")
dc7e5783 1920 (version "1.0.6")
3239dcd3
PAR
1921 (source
1922 (origin
dc7e5783
EF
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"))))
3239dcd3
PAR
1929 (build-system gnu-build-system)
1930 (inputs
dc7e5783 1931 `(("curl" ,curl)
4bd428a7 1932 ("libjpeg" ,libjpeg-turbo)
dc7e5783 1933 ("ncurses" ,ncurses)))
3239dcd3
PAR
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)))
0290f533
RH
1939
1940(define-public grim
1941 (package
444c4c08 1942 (name "grim")
caf4df50 1943 (version "1.3.1")
444c4c08
RH
1944 (source
1945 (origin
90c7ea44
TGR
1946 (method git-fetch)
1947 (uri (git-reference
b0e7b699 1948 (url "https://github.com/emersion/grim")
90c7ea44
TGR
1949 (commit (string-append "v" version))))
1950 (file-name (git-file-name name version))
444c4c08 1951 (sha256
caf4df50 1952 (base32 "0fjmjq0ws9rlblkcqxxw2lv7zvvyi618jqzlnz5z9zb477jwdfib"))))
444c4c08 1953 (build-system meson-build-system)
355dd713
BT
1954 (native-inputs `(("pkg-config" ,pkg-config)
1955 ("scdoc" ,scdoc)))
444c4c08
RH
1956 (inputs `(("cairo" ,cairo)
1957 ("libjpeg-turbo" ,libjpeg-turbo)
444c4c08
RH
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)))
bd86a1be
RH
1965
1966(define-public slurp
1967 (package
1968 (name "slurp")
7d5113e5 1969 (version "1.2.0")
bd86a1be
RH
1970 (source
1971 (origin
1972 (method git-fetch)
1973 (uri (git-reference
b0e7b699 1974 (url "https://github.com/emersion/slurp")
bd86a1be
RH
1975 (commit (string-append "v" version))))
1976 (file-name (git-file-name name version))
1977 (sha256
7d5113e5 1978 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
bd86a1be
RH
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
1988to the standard output. It works well together with grim.")
1989 ;; MIT license.
1990 (license license:expat)))
d54ca1cd
VC
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
2022specifically to represent the entire contents of a PNG (Portable Network
2023Graphics) file in an editable form. Thus, SNGs representing elaborate
2024graphics images and ancillary chunk data can be readily generated or modified
2025using only text tools.
2026
2027SNG is implemented by a compiler/decompiler called sng that
2028losslessly translates between SNG and PNG.")
2029 (license license:zlib)))
7eed5845
GL
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,
2082no dependency or linkage required. It's made for C (ISO C90), and has a C++
2083wrapper with a more convenient interface on top.")
2084 (license license:zlib))))
14138912
HG
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
2106bitmaps from Microsoft Windows icon and cursor files. These files usually
2107have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2108in executables and libraries (@code{.dll}-files). (Such embedded files are
2109referred to as resources.)
2110
2111Conversion of these files to and from PNG images is done @command{icotool}.
2112@command{extresso} automates these tasks with the help of special resource
2113scripts. Resources such can be extracted from MS Windows executable and
2114library files with @command{wrestool}.
2115
2116This package can be used to create @code{favicon.ico} files for web sites.")
2117 (license license:gpl3+)))
fecd608f
LF
2118
2119(define-public libavif
2120 (package
2121 (name "libavif")
8d7ee11a 2122 (version "0.7.3")
fecd608f
LF
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
8d7ee11a 2131 "17hagdngpc4xzrr0aa48nx399y5lawyyx9cpcdhpds1mqk6p77lp"))))
fecd608f
LF
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
d7041a69
LF
2139 (replace 'check
2140 (lambda _
2141 (invoke "./aviftest" "../source/tests/data")))
fecd608f
LF
2142 (add-after 'install 'install-readme
2143 (lambda* (#:key outputs #:allow-other-keys)
2144 (let* ((out (assoc-ref outputs "out"))
d7041a69
LF
2145 (doc (string-append out "/share/doc/libavif-" ,version)))
2146 (install-file "../source/README.md" doc)
2147 #t))))))
fecd608f
LF
2148 (inputs
2149 `(("libaom" ,libaom)
2150 ("dav1d" ,dav1d)))
2151 (synopsis "Encode and decode AVIF files")
51b25847
TGR
2152 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
2153File Format}. It can encode and decode all YUV formats and bit depths supported
2154by AOM, including with alpha.")
fecd608f
LF
2155 (home-page "https://github.com/AOMediaCodec/libavif")
2156 (license (list license:bsd-2 ; libavif itself
2157 license:expat)))) ; cJSON in the test suite
95b800e6
VK
2158
2159(define-public mtpaint
996b3f71
TGR
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.
6e13b0ef 2164 (version "3.49.27")
996b3f71
TGR
2165 (source
2166 (origin
2167 (method git-fetch)
2168 (uri (git-reference
2169 (url "https://github.com/wjaguar/mtPaint")
6e13b0ef 2170 (commit "26751cd0336414e2f16cbe25c9fe2702f34e7b5c")))
996b3f71
TGR
2171 (file-name (git-file-name name version))
2172 (sha256
6e13b0ef 2173 (base32 "12mzai9pqvyb342m21rjz0jxiy75q24sjw6ax147pzy8frzkgd54"))))
996b3f71
TGR
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.
95b800e6
VK
2201It can create and edit indexed palette or 24bit RGB images, offers basic
2202painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2203GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
996b3f71 2204 (license license:gpl3+)))
1367ee7a
AI
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
2252time information in photos and videos to organize them into folders by year,
2253month and day. All files which are not images or videos or those which do not
2254have creation date information will be placed in a folder called
2255@file{unknown}.")
2256 (license license:expat)))