Right now I’m using gifs to overcome this which creates a huge performance issue on my page.
Would be nice to have WebM support to decrease these files in size.
I just added mp4, but I don’t need this.
It looks like something is happening on this
committed 10:04AM - 26 May 22 UTC
refs https://github.com/TryGhost/Team/issues/1652
refs https://github.com/TryGho… st/Ghost/issues/13319
- Added support for animated webp and gifs optimization and resizing
- Added optinal `format` option to `unsafeResizeFromBuffer` and `resizeFromBuffer`. E.g. allows you to convert a .svg file to a .png.
- Added optional `animated` option to `unsafeResizeFromBuffer` and `resizeFromBuffer`. Defaults to 'maintain animation'.
- Added optional `withoutEnlargement` option to `unsafeResizeFromBuffer` and `resizeFromBuffer`. Defaults to true. Required to increase SVG size.
- Removed gif and svg from `canTransformFileExtension`. They are supported by sharp now.
- Added `shouldResizeFileExtension` method, which returns if we should resize an image. This is required to prevent resizing SVG files (while it is supported, it is not desired), while allowing them to be converted to PNG (thats why a new method was needed).
- Added `canTransformToFileExtension` to validate the `format` option.
- Removed the leading dot in all extension check methods. Why? Because the format option of sharp doesn't use the dot at the beginning. And making it consistent helps with type checking (e.g. make use of `keyof import('sharp').FormatEnum`)
- Improved TS/JSDoc type inheritance when `makeSafe` is used.
1 Like