about summary refs log tree commit diff stats
path: root/adapter/img
Commit message (Collapse)AuthorAgeFilesLines
* sixel: break out into a separate cgi scriptbptato2024-08-241-0/+202
| | | | | | | | This caches sixel output. Works best when the line height is a multiple of 6px, but should still be faster than the previous solution everywhere else too (simply by virtue of encoding separate images in parallel). Next step: actual color quantization
* jebp: fix NEON simd bugbptato2024-07-231-1/+1
| | | | | | SRCtype and DSTtype were mixed up. See https://todo.sr.ht/~bptato/chawan/14
* img: add webp decoder (jebp)bptato2024-07-203-0/+4852
| | | | | | | | | | 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
* stbi: fix incompatible function pointer typebptato2024-07-181-2/+2
| | | | clang complains about this
* img, makefile: remove png, update uninstall targetbptato2024-07-031-553/+0
|
* pager: PNGify kitty images, clear images on buffer switchbptato2024-07-021-2/+10
| | | | | | | | | | | Saves bandwidth; it's especially useful over SSH. Still not sure if this is the right solution, since it now needs two select cycles instead of one, and it does yet another copy of the image. (Unnecessarily, because stbi cannot stream its output, and stbiw cannot stream its input.) Also, to save memory, we now discard decoded images of buffers that are not being viewed.
* stbi: fix broken allocation in resizingbptato2024-06-291-1/+1
| | | | ;_;
* img, loader: add image resizing, misc fixesbptato2024-06-283-10/+2688
| | | | | | | | | | | | | | | * resize images with stb_image_resize * use tee for output handle redirection (redirectToFile blocks) * cache original image files * accept lseek in sandbox * misc stbi fixes For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in size, not sure if it's worth the cost. (Either way, we can always switch later if needed, since the API is almost the same.) Next step: move sixel/kitty encoders to CGI, and cache their output in memory instead of the intermediate RGBA representation.
* stbi: allow x-unknownbptato2024-06-221-1/+1
|
* stbi: add encodersbptato2024-06-213-17/+1807
|
* img: use stb_image, drop zlib as dependencybptato2024-06-204-19/+8087
| | | | | | | Now we have decoders for gif, jpeg, bmp. Also, the in-house PNG decoder has been replaced in favor of the stbi implementation; this means we no longer depend on zlib, since stbi comes with a built in inflate implementation.
* img, loader: separate out png codec into cgi, misc improvementsbptato2024-06-201-0/+544
* multi-processed and sandboxed PNG decoding & encoding (through local CGI) * improved request body passing (including support for output id as response body) * simplified & faster blob()/text() - now every request starts suspended, and OngoingData.buf has been replaced with loader's buffering capability * image caching: we no longer pull bitmaps from the container after every single getLines call Next steps: replace our bespoke PNG decoder with something more usable, add other decoders, and make them stream.