Fix .Width and .Height for animated gifs

Fixes #11079
This commit is contained in:
Bjørn Erik Pedersen
2023-06-14 08:14:39 +02:00
parent 35e9b3ed1e
commit 21d17566a3
4 changed files with 30 additions and 10 deletions

View File

@@ -377,6 +377,9 @@ type imageConfig struct {
}
func imageConfigFromImage(img image.Image) image.Config {
if giphy, ok := img.(Giphy); ok {
return giphy.GIF().Config
}
b := img.Bounds()
return image.Config{Width: b.Max.X, Height: b.Max.Y}
}