bimg icon indicating copy to clipboard operation
bimg copied to clipboard

Don't you support gif resizing?

Open ohtaeg opened this issue 4 years ago • 3 comments

The following error was encountered during the gif resizing process. Unsupported image output type

code sample

import (
	"fmt"
	"github.com/h2non/bimg"
	"log"
)

func foo(width int, height int) {
    buffer, err := bimg.Read("img/test.gif")
    if err != nil {
        fmt.Fprintln(os.Stderr, err)
        return
    }

    newImage := bimg.NewImage(buffer)
    bimgOpt := bimg.Options{
        Width:   width,
	Height:  height,
	Crop:    true,
	Gravity: bimg.GravityCentre,
    }

    process, err := newImage.Process(bimgOpt)
    if err != nil {
        fmt.Println("1") 
        log.Fatalln(err.Error()) // error occured
	return
    }

    err = bimg.Write("output/test1.gif", process)
    if err != nil {
        fmt.Println("2")
        log.Fatalln(err.Error())
    }
}

I wonder if there is any plan to update the function.

thanks.

ohtaeg avatar Mar 21 '22 20:03 ohtaeg

Hello, me too. Is that all right now?

1713172499 avatar May 20 '22 06:05 1713172499

Unfortunately, it's the same.

ohtaeg avatar May 20 '22 09:05 ohtaeg

I think the reason is the underlying libvips that you use, not bimg. It needs to be compiled with GIF support. Which distribution/OS are you using?

der-eismann avatar Jun 07 '22 11:06 der-eismann