MCPcopy Create free account
hub / github.com/fogleman/primitive / LoadImage

Function LoadImage

primitive/util.go:19–32  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

17)
18
19func 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
34func SaveFile(path, contents string) error {
35 if path == "-" {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…