Ext returns the file extension for the image type.
()
| 39 | |
| 40 | // Ext returns the file extension for the image type. |
| 41 | func (t Type) Ext() string { |
| 42 | desc := GetTypeDesc(t) |
| 43 | if desc != nil { |
| 44 | return desc.Ext |
| 45 | } |
| 46 | |
| 47 | return "" |
| 48 | } |
| 49 | |
| 50 | // MarshalJSON implements the json.Marshaler interface for Type. |
| 51 | func (t Type) MarshalJSON() ([]byte, error) { |