svg.go 344 B

123456789101112131415
  1. package imagesize
  2. import (
  3. "io"
  4. )
  5. func init() {
  6. // Register fake svg decoder. Since we need this only for type detecting, we can
  7. // return fake image sizes
  8. decodeMeta := func(io.Reader) (*Meta, error) {
  9. return &Meta{Format: "svg", Width: 1, Height: 1}, nil
  10. }
  11. RegisterFormat("<?xml ", decodeMeta)
  12. RegisterFormat("<svg", decodeMeta)
  13. }