Need help with go-imageupload?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

olahol
137 Stars 14 Forks 5 Commits 0 Opened issues

Description

:white_square_button: Gracefully handle image uploading and thumbnail creation.

Services available

!
?

Need anything else?

Contributors list

# 30,249
Go
seleniu...
Node.js
React
4 commits
# 87,723
angular...
golang
pbxproj
passcod...
1 commit

go-imageupload

GoDoc

:whitesquarebutton: Gracefully handle image uploading and thumbnail creation.

Install

go get github.com/olahol/go-imageupload

Example

Thumbnail creator using Gin.

package main

import ( "github.com/gin-gonic/gin" "github.com/olahol/go-imageupload" )

func main() { r := gin.Default()

r.GET("/", func(c *gin.Context) {
    c.File("index.html")
})

r.POST("/upload", func(c *gin.Context) {
    img, err := imageupload.Process(c.Request, "file")

    if err != nil {
        panic(err)
    }

    thumb, err := imageupload.ThumbnailPNG(img, 300, 300)

    if err != nil {
        panic(err)
    }

    thumb.Write(c.Writer)
})

r.Run(":5000")

}

  

Contributors

  • Ola Holmström (@olahol)
  • Shintaro Kaneko (@kaneshin)

Documentation

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.