Fix loading animated images with a huge number of frames

This commit is contained in:
DarthSim
2023-12-20 19:34:29 +03:00
parent 9e5abde24e
commit 22e16ebe56
3 changed files with 12 additions and 5 deletions

View File

@@ -292,6 +292,14 @@ func (img *Image) Height() int {
return int(img.VipsImage.Ysize)
}
func (img *Image) Pages() int {
p, err := img.GetIntDefault("n-pages", 1)
if err != nil {
return 1
}
return p
}
func (img *Image) Load(imgdata *imagedata.ImageData, shrink int, scale float64, pages int) error {
if imgdata.Type == imagetype.ICO {
return img.loadIco(imgdata.Data, shrink, scale, pages)