Merge pull request #77 from h2non/develop

Promote v0.1.23
master
Tomás Aparicio 10 years ago
commit 6ca41bbafc

@ -32,14 +32,6 @@ func Resize(buf []byte, o Options) ([]byte, error) {
debug("Options: %#v", o)
// Initial image auto rotate / flip for proper transformation calculus
if o.Rotate == 0 {
image, err = rotateAndFlipImage(image, o)
if err != nil {
return nil, err
}
}
inWidth := int(image.Xsize)
inHeight := int(image.Ysize)
@ -76,6 +68,12 @@ func Resize(buf []byte, o Options) ([]byte, error) {
residual = float64(shrink) / factor
}
// Explicit or auto rotate image based on EXIF header
image, err = rotateAndFlipImage(image, o)
if err != nil {
return nil, err
}
// Zoom image, if necessary
image, err = zoomImage(image, o.Zoom)
if err != nil {
@ -104,12 +102,6 @@ func Resize(buf []byte, o Options) ([]byte, error) {
return nil, err
}
// Transform to original rotation, if necessary
image, err = rotateAndFlipImage(image, o)
if err != nil {
return nil, err
}
// Flatten image on a background, if necessary
image, err = imageFlatten(image, imageType, o)
if err != nil {
@ -266,7 +258,7 @@ func rotateAndFlipImage(image *C.VipsImage, o Options) (*C.VipsImage, error) {
if flip {
o.Flip = flip
}
if rotation > D0 && o.Rotate == 0 {
if rotation > 0 && o.Rotate == 0 {
o.Rotate = rotation
}
}

@ -1,3 +1,3 @@
package bimg
const Version = "0.1.22"
const Version = "0.1.23"

Loading…
Cancel
Save