Getting some wierd images
FirstCaptain opened this issue · comments
Running this give me some weird image results with the re sizing
Here is my parameters
cat inputfile.jpg | ./bin/images -width 2672 -height 1283 > outfile.jpg
package main
import (
"flag"
"github.com/nfnt/resize"
"image"
"image/jpeg"
"os"
)
func main() {
var w, h uint
flag.UintVar(&w, "w", 0, "width value")
flag.UintVar(&h, "h", 0, "height value")
flag.Parse()
if w == 0 || h == 0 {
fmt.Println("Width and Height can't be 0")
os.Exit(560)
}
// Decode the image.
m, _, _ := image.Decode(os.Stdin)
m = resize.Resize(w, h, m, resize.Lanczos3)
nfile, _ := os.Create("NewCostaRicanFrog.jpg")
jpeg.Encode(os.Stdout, m, nil)
file.Close()
}