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

Function SaveImage

update.go:434–442  ·  view source on GitHub ↗
(m image.Image, path string)

Source from the content-addressed store, hash-verified

432}
433
434func SaveImage(m image.Image, path string) error {
435 switch filepath.Ext(path) {
436 case ".jpg":
437 return SaveJPG(m, path)
438 case ".png":
439 return SavePNG(m, path)
440 }
441 return errors.New("unknown output format")
442}
443
444func SaveJPG(m image.Image, path string) error {
445 os.MkdirAll(filepath.Dir(path), 0755)

Callers 1

MakeCollageFunction · 0.85

Calls 2

SaveJPGFunction · 0.85
SavePNGFunction · 0.85

Tested by

no test coverage detected