willnorris / imageproxy

A caching, resizing image proxy written in Go
Apache License 2.0
3.51k stars 480 forks source link

avif #307

Open gedw99 opened 3 years ago

gedw99 commented 3 years ago

https://caniuse.com/avif

Would you consider avif worth supporting ?

I know its NOT supported on browsers but it will eventually, and i would like to put it into blue green ops

willnorris commented 3 years ago

I'm not opposed to supporting the format, but I imagine it will run into the same problem as webp and HEIC (some of which is discussed in #114 and #292), which is the lack of a native Go library for encoding and decoding. https://github.com/Kagami/go-avif seems to be the main option for Go, and it requires cgo, which I'm avoiding in this project for now.

The one-day, maybe, eventual rearchitecture of imageproxy as described in https://github.com/willnorris/imageproxy/blob/main/docs/plugin-design.md would be the most likely solution for opening up the option for cgo libraries. But as discussed there, I have no immediate plans for that rewrite, and honestly may never get around to it.

In the meantime, it looks like imgproxy (different project, similar name) does have AVIF support, since they use libvips for image encoding/decoding: https://github.com/imgproxy/imgproxy/issues/456. imgproxy requires that you bring your own caching (like putting it behind a CDN), which may or may not be what you're looking for.