Open g-mero opened 1 year ago
// SetPages sets the number of pages in the Image // For animated images this corresponds to the number of frames
func (r *ImageRef) SetPages(pages int) error { out, err := vipsCopyImage(r.image) if err != nil { return err } vipsSetImageNPages(r.image, pages) r.setImage(out) return nil }
I attempted to use the SetPages method to keep only the first frame of an animated image and export it to a JPEG file, but it doesn't work. After reviewing the code, it appears to merely duplicate the original image.
How about setting the page=1 in vips.ImportParams, then just load one page for animated images
vips.ImportParams
// SetPages sets the number of pages in the Image // For animated images this corresponds to the number of frames
I attempted to use the SetPages method to keep only the first frame of an animated image and export it to a JPEG file, but it doesn't work. After reviewing the code, it appears to merely duplicate the original image.