webp-sh / webp_server_go

Go version of WebP Server. A tool that will serve your JPG/PNG/BMP/SVGs as WebP/AVIF format with compression, on-the-fly.

Home Page:https://docs.webp.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Couldn't load xx.ico file

IamTaoChen opened this issue · comments

Describe the bug

Could not read .ico file.

webp  | WebP Server Go is Running on http://0.0.0.0:3333
webp  | panic: runtime error: invalid memory address or nil pointer dereference
webp  | 	panic: runtime error: invalid memory address or nil pointer dereference
webp  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x796f2a]
webp  | 
webp  | goroutine 25 [running]:
webp  | github.com/davidbyttow/govips/v2/vips.(*ImageRef).Close(0x0)
webp  | 	/go/pkg/mod/github.com/davidbyttow/govips/v2@v2.13.0/vips/image.go:575 +0x2a
webp  | panic({0x829040?, 0xba4380?})
webp  | 	/usr/local/go/src/runtime/panic.go:770 +0x132
webp  | github.com/davidbyttow/govips/v2/vips.(*ImageRef).Format(...)
webp  | 	/go/pkg/mod/github.com/davidbyttow/govips/v2@v2.13.0/vips/image.go:589
webp  | github.com/davidbyttow/govips/v2/vips.(*ImageRef).Metadata(0x0)
webp  | 	/go/pkg/mod/github.com/davidbyttow/govips/v2@v2.13.0/vips/image.go:491 +0x17
webp  | webp_server_go/encoder.preProcessImage(0x0, {0x899619?, 0xc0000a4e50?}, {0x0?, 0x0?})
webp  | 	/build/encoder/process.go:62 +0x4b
webp  | webp_server_go/encoder.convertImage({0xc000136e90, 0x10}, {0xc000142840, 0x23}, {0x899619, 0x4}, {0x0?, 0xc000092fd0?})
webp  | 	/build/encoder/encoder.go:119 +0x2ca
webp  | webp_server_go/encoder.ConvertFilter.func2()
webp  | 	/build/encoder/encoder.go:71 +0x51
webp  | created by webp_server_go/encoder.ConvertFilter in goroutine 24
webp  | 	/build/encoder/encoder.go:70 +0x386
webp exited with code 0

To Reproduce
Steps to reproduce the behavior

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots and logs
If applicable, add screenshots and logs to help explain your problem.

Environment (please complete the following information):

  • OS: linux-docker
  • version: v0.10.7

Additional context
Add any other context about the problem here.

Thanks for feedback, but we don't currently support ICO files(because libvips will panic on ico files), as per our docs: https://docs.webp.sh/, we support the following files:

Currently supported image format: JPEG, PNG, BMP, GIF, SVG, HEIC, NEF, WEBP

From our default configuration ICO files should be ignored, could you share us a bit more about your configuration and usage?

thanks to know this.

{
    "HOST": "0.0.0.0",
    "PORT": "3333",
    "QUALITY": "80",
    "IMG_PATH": "./pics",
    "EXHAUST_PATH": "./exhaust",
    "ALLOWED_TYPES": ["jpg","png","jpeg","bmp","gif","svg","heic","ico","webp","avif"],
    "IMG_MAP": {},
    "ENABLE_AVIF": false,
    "ENABLE_EXTRA_PARAMS": true
  }

remove ico from your config and it should work