2018-12-11 12:02:23 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
2019-01-11 17:08:34 +02:00
|
|
|
"image/color"
|
2018-12-11 12:02:23 +02:00
|
|
|
"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) {
|
2019-01-11 17:08:34 +02:00
|
|
|
return image.Config{ColorModel: color.RGBAModel, Width: 1, Height: 1}, nil
|
2018-12-11 12:02:23 +02:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|