nfnt / resize

Pure golang image resizing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting some wierd images

FirstCaptain opened this issue · comments

inputfile
outputfile

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()

}

Are you using the latest version? This issue is the same as reported in #6 and was fixed in f8ec710. I cannot reproduce your behaviour using the latest version.