(path string)
| 17 | ) |
| 18 | |
| 19 | func LoadImage(path string) (image.Image, error) { |
| 20 | if path == "-" { |
| 21 | im, _, err := image.Decode(os.Stdin) |
| 22 | return im, err |
| 23 | } else { |
| 24 | file, err := os.Open(path) |
| 25 | if err != nil { |
| 26 | return nil, err |
| 27 | } |
| 28 | defer file.Close() |
| 29 | im, _, err := image.Decode(file) |
| 30 | return im, err |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func SaveFile(path, contents string) error { |
| 35 | if path == "-" { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…