refactor(resize)

master
Tomas Aparicio 11 years ago
parent 3b9b0ca98f
commit 6f5f7ff644

@ -118,18 +118,18 @@ func Resize(buf []byte, o Options) ([]byte, error) {
return nil, err return nil, err
} }
// Add watermark if necessary
image, err = watermakImage(image, o.Watermark)
if err != nil {
return nil, err
}
saveOptions := vipsSaveOptions{ saveOptions := vipsSaveOptions{
Quality: o.Quality, Quality: o.Quality,
Type: o.Type, Type: o.Type,
Compression: o.Compression, Compression: o.Compression,
} }
// watermark
image, err = watermakImage(image, o.Watermark)
if err != nil {
return nil, err
}
// Finally save as buffer // Finally save as buffer
buf, err = vipsSave(image, saveOptions) buf, err = vipsSave(image, saveOptions)
if err != nil { if err != nil {

Loading…
Cancel
Save