2019-12-25 11:06:15 +02:00
|
|
|
package imagemeta
|
2019-09-25 17:46:59 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
// Register fake svg decoder. Since we need this only for type detecting, we can
|
|
|
|
// return fake image sizes
|
2019-12-25 11:06:15 +02:00
|
|
|
decodeMeta := func(io.Reader) (Meta, error) {
|
|
|
|
return &meta{format: "svg", width: 1, height: 1}, nil
|
2019-09-25 17:46:59 +02:00
|
|
|
}
|
|
|
|
RegisterFormat("<?xml ", decodeMeta)
|
|
|
|
RegisterFormat("<svg", decodeMeta)
|
2020-02-03 13:44:49 +02:00
|
|
|
// We believe that file starting with HTML comment is SVG
|
|
|
|
RegisterFormat("<!--", decodeMeta)
|
2019-09-25 17:46:59 +02:00
|
|
|
}
|