mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 12:12:40 +02:00
Fix not animated gifs support
This commit is contained in:
@@ -524,7 +524,7 @@ func processImage(ctx context.Context) ([]byte, error) {
|
||||
}
|
||||
defer C.clear_image(&img)
|
||||
|
||||
if imgtype == imageTypeGIF && po.Format == imageTypeGIF {
|
||||
if imgtype == imageTypeGIF && po.Format == imageTypeGIF && vipsIsAnimatedGif(img) {
|
||||
if err := transformGif(ctx, &img, po); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -682,6 +682,10 @@ func vipsArrayjoin(in []*C.struct__VipsImage, out **C.struct__VipsImage) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func vipsIsAnimatedGif(img *C.struct__VipsImage) bool {
|
||||
return C.vips_is_animated_gif(img) > 0
|
||||
}
|
||||
|
||||
func vipsImageHasAlpha(img *C.struct__VipsImage) bool {
|
||||
return C.vips_image_hasalpha_go(img) > 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user