mirror of https://github.com/status-im/resize.git
Update README.md to mention resize.Thumbnail.
This commit is contained in:
parent
079ed2e48a
commit
8aee0d995b
|
@ -23,11 +23,16 @@ Import package with
|
||||||
import "github.com/nfnt/resize"
|
import "github.com/nfnt/resize"
|
||||||
```
|
```
|
||||||
|
|
||||||
Resize creates a scaled image with new dimensions (`width`, `height`) using the interpolation function `interp`.
|
The resize package provides 2 functions:
|
||||||
If either `width` or `height` is set to 0, it will be set to an aspect ratio preserving value.
|
|
||||||
|
* `resize.Resize` creates a scaled image with new dimensions (`width`, `height`) using the interpolation function `interp`.
|
||||||
|
If either `width` or `height` is set to 0, it will be set to an aspect ratio preserving value.
|
||||||
|
* `resize.Thumbnail` downscales an image preserving its aspect ratio to the maximum dimensions (`maxWidth`, `maxHeight`).
|
||||||
|
It will return the original image if original sizes are smaller than the provided dimensions.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
resize.Resize(width, height uint, img image.Image, interp resize.InterpolationFunction) image.Image
|
resize.Resize(width, height uint, img image.Image, interp resize.InterpolationFunction) image.Image
|
||||||
|
resize.Thumbnail(maxWidth, maxHeight uint, img image.Image, interp resize.InterpolationFunction) image.Image
|
||||||
```
|
```
|
||||||
|
|
||||||
The provided interpolation functions are (from fast to slow execution time)
|
The provided interpolation functions are (from fast to slow execution time)
|
||||||
|
|
Loading…
Reference in New Issue