mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 04:46:24 +02:00
parent
2eb6dfcd05
commit
8484518c93
6 changed files with 114 additions and 7 deletions
|
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/disintegration/imaging"
|
||||
"github.com/muesli/smartcrop"
|
||||
"github.com/muesli/smartcrop/nfnt"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/rwcarlsen/goexif/exif"
|
||||
"golang.org/x/image/bmp" // register bmp format
|
||||
"golang.org/x/image/tiff" // register tiff format
|
||||
|
|
@ -274,6 +275,9 @@ func exifOrientation(r io.Reader) (opt Options) {
|
|||
// transformImage modifies the image m based on the transformations specified
|
||||
// in opt.
|
||||
func transformImage(m image.Image, opt Options) image.Image {
|
||||
timer := prometheus.NewTimer(imageTransformationSummary)
|
||||
defer timer.ObserveDuration()
|
||||
|
||||
// Parse crop and resize parameters before applying any transforms.
|
||||
// This is to ensure that any percentage-based values are based off the
|
||||
// size of the original image.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue