Skip to content

Commit 927197a

Browse files
committed
Added support for transforming AVIF files
no issue - This adds the possibility to format AVIF files in Ghost if requested. - This format is supported in Sharp - Provides smaller file sizes than webp
1 parent f9e8db2 commit 927197a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/image-transform/lib/transform.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const shouldResizeFileExtension = ext => !['.ico', '.svg', '.svgz'].includes(ext
3333

3434
/**
3535
* Can we output animation (prevents outputting animated JPGs that are just all the pages listed under each other)
36+
* Sharp doesn't support AVIF image sequences yet (animation)
3637
* @param {keyof import('sharp').FormatEnum} format the extension to check, EXCLUDING the leading dot
3738
*/
3839
const doesFormatSupportAnimation = format => ['webp', 'gif'].includes(format);
@@ -47,7 +48,8 @@ const canTransformToFormat = format => [
4748
'jpeg',
4849
'jpg',
4950
'png',
50-
'webp'
51+
'webp',
52+
'avif'
5153
].includes(format);
5254

5355
/**

0 commit comments

Comments
 (0)