LoadFromFile

Load an image from an instance of *os.File . It is recommended to use the Load method to load an image.

Parameters

ParameterTypeDescription

file

*os.File

The instance of *os.File .

Return Values

The instance of *imgo.Image .

Examples

package main

import (
    "github.com/fishtailstudio/imgo"
    "os"
)

func main() {
    file, err := os.Open("gopher.png")
    if err != nil {
        panic(err)
    }
    defer file.Close()

    imgo.LoadFromFile(file).
        Save("out.png")
}

Last updated