Skip to content

Commit

Permalink
Simpler example.
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Dec 1, 2014
1 parent d77d6cf commit 1e9f6fa
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/muesli/smartcrop"
"fmt"
"image"
_ "image/jpeg"
_ "image/png"
"os"
)
Expand All @@ -38,15 +37,8 @@ func main() {
fi, _ := os.Open("test.png")
defer fi.Close()

img, _, err := image.Decode(fi)
if err != nil {
panic(err)
}

topCrop, err := smartcrop.SmartCrop(&img, 250, 250)
if err != nil {
panic(err)
}
img, _, _ := image.Decode(fi)
topCrop, _ := smartcrop.SmartCrop(&img, 250, 250)
fmt.Printf("Top crop: %+v\n", topCrop)
}
```
Expand Down

0 comments on commit 1e9f6fa

Please sign in to comment.