next-img icon indicating copy to clipboard operation
next-img copied to clipboard

AVIF support

Open stopyransky opened this issue 4 years ago • 3 comments

Hi,

is there a chance to include AVIF file support in the plugin ? It is new format for media files, not yet supported by all browsers but it's on the way.

Examples of implementation as Progressive Enhancement with AVIF:

<picture>
	<source srcset="img/photo.avif" type="image/avif">
	<source srcset="img/photo.webp" type="image/webp">
	<img src="img/photo.jpg" alt="Description of Photo">
</picture>

Sources: https://reachlightspeed.com/blog/using-the-new-high-performance-avif-image-format-on-the-web-today/ https://www.ctrl.blog/entry/webp-avif-comparison.html

stopyransky avatar Aug 26 '20 21:08 stopyransky

100%, will be adding that in the near future. Need to understand if Sharp's implementation will work or if another lib will be necessary.

KidkArolis avatar Aug 27 '20 09:08 KidkArolis

There's some discussion here on sharp's support for avif: https://github.com/lovell/sharp/issues/2289

KidkArolis avatar Aug 27 '20 10:08 KidkArolis

Sharp added avif, so this should be possible to implement now!

KidkArolis avatar Apr 16 '23 15:04 KidkArolis