h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
https://fly.io/docs/app-guides/run-a-global-image-service/
MIT License
5.5k stars 455 forks source link

Don't you support gif resizing? #388

Closed ohtaeg closed 2 years ago

ohtaeg commented 2 years ago

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 commented 2 years ago

sorry, This issue has been transferred to bimg.