h2non / bimg

Go package for fast high-level image processing powered by libvips C library
https://pkg.go.dev/github.com/h2non/bimg?tab=doc
MIT License
2.68k stars 337 forks source link

image resize failed with error:magicsave_buffer: libMagick error: no decode delegate for this image format #400

Open dxsooo opened 2 years ago

dxsooo commented 2 years ago

I read my BMP file and use the following code:

image := bimg.NewImage(bytes)
bytes, err = image.Resize(nW, nH)
if err != nil {
    return nil, err
}

err is not nil and message is: magicsave_buffer: libMagick error: no decode delegate for this image format `' @ error/blob.c/ImageToBlob/2452\n

I guess it may be something wrong with my libMagick or libvips, but both convert and vipsthumbnail works fine.

So it there something special in bimg?

my lib version: libvips 8.12 imagemagick 7.1.0 bimg v2.0 (both master and dev branch is tested, and 2.0-dev branch err in image.Save)

the image used (zip in zip file to ensure github not change it) aa64890e45ac28fed2f158e00580adafb9926ba6ddf4da84628dbc05a2ea4f5c.zip