about summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-01 19:55:19 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-20 14:09:16 +0200
commit2a9b57b6b6a68af453e75384300887bacc3f6add (patch)
tree7c3246199f450856ffcbf8a7355ebb01dad78fde /res
parent38cc49aa7f8a9d616cb57ce025a2add3e855f5c9 (diff)
downloadchawan-2a9b57b6b6a68af453e75384300887bacc3f6add.tar.gz
img: add webp decoder (jebp)
It works fine AFAICT, just missing VP8 deblocking filters, so lossy
WebP images don't look great.

I have extended the API a bit to allow reading from stdin, not just
paths. Otherwise, it's the same as matanui159/jebp.

TODO: add loop filters
Diffstat (limited to 'res')
-rw-r--r--res/license.md26
-rw-r--r--res/mime.types1
-rw-r--r--res/urimethodmap1
3 files changed, 28 insertions, 0 deletions
diff --git a/res/license.md b/res/license.md
index 64a86961..fbc53205 100644
--- a/res/license.md
+++ b/res/license.md
@@ -119,3 +119,29 @@ The stb_image, stb_image_write and stb_image_resize libraries by
 Sean Barrett et al. are used for image transcoding. These libraries
 are dedicated to the public domain, and are distributed under the same
 terms as Chawan.
+
+## jebp
+
+A slightly modified version of the jebp library by Jasmine Minter is used for
+decoding WebP images. This library is distributed under the following license:
+
+```
+MIT No Attribution
+
+Copyright 2022 Jasmine Minter
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+```
diff --git a/res/mime.types b/res/mime.types
index 1e28deb5..5eff1452 100644
--- a/res/mime.types
+++ b/res/mime.types
@@ -11,6 +11,7 @@ image/png		png
 image/jpeg		jpg
 image/bmp		bmp
 image/gif		gif
+image/webp		webp
 text/markdown		md
 text/gemini		gmi
 text/x-ansi		ans	asc
diff --git a/res/urimethodmap b/res/urimethodmap
index dd9b5e94..40e97bd7 100644
--- a/res/urimethodmap
+++ b/res/urimethodmap
@@ -21,3 +21,4 @@ img-codec+jpeg:		cgi-bin:stbi
 img-codec+gif:		cgi-bin:stbi
 img-codec+bmp:		cgi-bin:stbi
 img-codec+x-unknown:	cgi-bin:stbi
+img-codec+webp:		cgi-bin:jebp