skip transform if options don't request it

Fixes #64
This commit is contained in:
Will Norris 2016-05-02 19:23:00 -07:00
parent d825852025
commit a71584a63c
3 changed files with 10 additions and 3 deletions

View file

@ -35,7 +35,7 @@ var resampleFilter = imaging.Lanczos
// encoded image in one of the supported formats (gif, jpeg, or png). The
// bytes of a similarly encoded image is returned.
func Transform(img []byte, opt Options) ([]byte, error) {
if opt == emptyOptions {
if !opt.transform() {
// bail if no transformation was requested
return img, nil
}