MCPcopy
hub / github.com/egonelbre/gophers / LoadImage

Function LoadImage

update.go:419–428  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

417}
418
419func LoadImage(path string) (image.Image, error) {
420 file, err := os.Open(path)
421 if err != nil {
422 return nil, err
423 }
424 defer file.Close()
425
426 m, _, err := image.Decode(file)
427 return m, err
428}
429
430func ReplaceExt(path, ext string) string {
431 return path[:len(path)-len(filepath.Ext(path))] + ext

Callers 2

MakeCollageFunction · 0.85
MakeThumbsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected