Free Trial
10 days, no credit_card

<< More Tutorials

How to resize an image to cover any dimensions in Go using rethumb?

To resize an image, with our "cover" operation, in Go use the following code:

package main

import (

func main() {
	paramOperation := "cover";
	paramValue := "150x200"; // New WIDTHxHEIGHT in pixels.

	imageURL := "";
	imageFilename := "resized-image.jpg";

	resp, err := http.Get(fmt.Sprintf("", paramOperation, paramValue, imageURL))
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)

	err = ioutil.WriteFile(imageFilename, body, 0644)

func check(e error) {
	if e != nil {

Start using this example now

Use the following commands to get started:

$ git clone
$ cd rethumb-go-examples
$ go build cover.go
$ ./cover

More examples using Go