Skip to content

Instantly share code, notes, and snippets.

@mamaz
Last active November 11, 2018 13:42
Show Gist options
  • Save mamaz/f881645e5bff55b9158960e5d947e81c to your computer and use it in GitHub Desktop.
Save mamaz/f881645e5bff55b9158960e5d947e81c to your computer and use it in GitHub Desktop.
Running Resize Image
package main
import (
resizeParallel "Exercise/ResizeImage/ResizeParallel"
resizeSequential "Exercise/ResizeImage/ResizeSequential"
"Exercise/ResizeImage/lib/types"
"flag"
"fmt"
)
func main() {
var inputFileName string
var maxprocs *int
flag.StringVar(&inputFileName, "input", "", "input filename")
maxprocs = flag.Int("maxprocs", -1, "maxprocs")
flag.Parse()
sizes := []types.Size{
types.Size{Width: 1280, Height: 800},
types.Size{Width: 1024, Height: 768},
types.Size{Width: 800, Height: 600},
}
fmt.Println("Input file name: ", inputFileName)
fmt.Println("Sizes: ", sizes)
fmt.Println("Maxprocs: ", *maxprocs)
if *maxprocs == -1 {
resizeSequential.ResizeSequential(inputFileName, sizes)
} else {
resizeParallel.ResizeParallel(inputFileName, sizes, *maxprocs)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment