mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-15 02:15:54 -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
|
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…
Add table
Add a link
Reference in a new issue