feat(image): Add GIF -> WEBP support (#4139) (#4140)

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
Jack Merrill 2022-08-05 17:32:45 -05:00 committed by GitHub
parent 1b9b78bc3a
commit 4678a3f358
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/image': patch
---
Added support for GIF to Animated WEBP images

View file

@ -82,7 +82,7 @@ class SharpService implements SSRImageService {
}
async transform(inputBuffer: Buffer, transform: TransformOptions) {
const sharpImage = sharp(inputBuffer, { failOnError: false });
const sharpImage = sharp(inputBuffer, { failOnError: false, pages: -1 });
// always call rotate to adjust for EXIF data orientation
sharpImage.rotate();