mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-13 01:10:29 -07:00
parent
f63020b40f
commit
e603ddd10a
8 changed files with 204 additions and 20 deletions
17
image.go
17
image.go
|
|
@ -75,6 +75,23 @@ func (i *Image) Thumbnail(pixels int) ([]byte, error) {
|
|||
return i.Process(options)
|
||||
}
|
||||
|
||||
// Insert an image. Alias to Watermark()
|
||||
func (i *Image) Insert(image []byte, left, top int) ([]byte, error) {
|
||||
return i.Watermark(image, left, top)
|
||||
}
|
||||
|
||||
// Insert an image to the existent one as watermark
|
||||
func (i *Image) Watermark(image []byte, left, top int) ([]byte, error) {
|
||||
options := Options{
|
||||
Insert: Insert{
|
||||
Buffer: image,
|
||||
Top: top,
|
||||
Left: left,
|
||||
},
|
||||
}
|
||||
return i.Process(options)
|
||||
}
|
||||
|
||||
// Rotate the image by given angle degrees (0, 90, 180 or 270)
|
||||
func (i *Image) Rotate(a Angle) ([]byte, error) {
|
||||
options := Options{Rotate: a}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue