mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-08 10:45:04 +02:00
18 lines
438 B
Go
18 lines
438 B
Go
package imagemeta
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
func init() {
|
|
// Register fake svg decoder. Since we need this only for type detecting, we can
|
|
// return fake image sizes
|
|
decodeMeta := func(io.Reader) (Meta, error) {
|
|
return &meta{format: "svg", width: 1, height: 1}, nil
|
|
}
|
|
RegisterFormat("<?xml ", decodeMeta)
|
|
RegisterFormat("<svg", decodeMeta)
|
|
// We believe that file starting with HTML comment is SVG
|
|
RegisterFormat("<!--", decodeMeta)
|
|
}
|