-
-
Save parzibyte/cfa61a32f015ea4ed20615afaa749339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func guardarImagenEnAlmacenamientoLocal(image image.Image) (string, error) { | |
nombreArchivo := "mi_imagen.png" | |
archivo, err := os.Create(nombreArchivo) | |
if err != nil { | |
return "", err | |
} | |
err = png.Encode(archivo, image) | |
if err != nil { | |
return "", err | |
} | |
err = archivo.Close() | |
if err != nil { | |
return "", err | |
} | |
return nombreArchivo, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment