mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
refactor(resize)
This commit is contained in:
parent
3b9b0ca98f
commit
6f5f7ff644
1 changed files with 6 additions and 6 deletions
12
resize.go
12
resize.go
|
|
@ -118,18 +118,18 @@ func Resize(buf []byte, o Options) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Add watermark if necessary
|
||||
image, err = watermakImage(image, o.Watermark)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
saveOptions := vipsSaveOptions{
|
||||
Quality: o.Quality,
|
||||
Type: o.Type,
|
||||
Compression: o.Compression,
|
||||
}
|
||||
|
||||
// watermark
|
||||
image, err = watermakImage(image, o.Watermark)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Finally save as buffer
|
||||
buf, err = vipsSave(image, saveOptions)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue