mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
fix(image): tests
This commit is contained in:
parent
4330593138
commit
f525611b29
3 changed files with 64 additions and 0 deletions
27
README.md
27
README.md
|
|
@ -163,6 +163,33 @@ if err != nil {
|
|||
bimg.Write("new.jpg", newImage)
|
||||
```
|
||||
|
||||
#### Fluent interface
|
||||
|
||||
```go
|
||||
buffer, err := bimg.Read("image.jpg")
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
|
||||
image := bimg.NewImage(buffer)
|
||||
|
||||
// first crop image
|
||||
_, err := image.CropByWidth(300)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
|
||||
// then flip it
|
||||
newImage, err := image.Flip()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
|
||||
// save the cropped and flipped image
|
||||
bimg.Write("new.jpg", newImage)
|
||||
```
|
||||
|
||||
|
||||
#### func DetermineImageTypeName
|
||||
|
||||
```go
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue