22 lines
296 B
Go
22 lines
296 B
Go
package main
|
|
|
|
import (
|
|
"image/jpeg"
|
|
"image/png"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
// open image
|
|
img, err := jpeg.Decode(os.Stdin)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
// no pre-processing needed so we just
|
|
// write image
|
|
err = png.Encode(os.Stdout, Downscaled{img, 3})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|