mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-29 08:22:11 +02:00
23 lines
453 B
Go
23 lines
453 B
Go
package main
|
|
|
|
import (
|
|
"image"
|
|
"image/color"
|
|
"io"
|
|
)
|
|
|
|
func init() {
|
|
// Register fake svg decoder. Since we need this only for type detecting, we can
|
|
// return fake image sizes
|
|
image.RegisterFormat(
|
|
"svg",
|
|
"<?xml ",
|
|
func(io.Reader) (image.Image, error) {
|
|
return image.NewRGBA(image.Rect(0, 0, 1, 1)), nil
|
|
},
|
|
func(io.Reader) (image.Config, error) {
|
|
return image.Config{ColorModel: color.RGBAModel, Width: 1, Height: 1}, nil
|
|
},
|
|
)
|
|
}
|