Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit 4dc4924

Browse files
authored
Revert "feat: crop max with and height (#13)" (#14)
This reverts commit 0e5216a.
1 parent 0e5216a commit 4dc4924

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

config/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ var (
3939
MaxAnimationFrames int
4040
MaxSvgCheckBytes int
4141
MaxRedirects int
42-
CropMaxWidth int
43-
CropMaxHeight int
4442

4543
JpegProgressive bool
4644
PngInterlaced bool
@@ -385,9 +383,6 @@ func Configure() error {
385383

386384
configurators.Int(&MaxRedirects, "IMGPROXY_MAX_REDIRECTS")
387385

388-
configurators.Int(&CropMaxWidth, "IMGPROXY_CROP_MAX_WIDTH")
389-
configurators.Int(&CropMaxHeight, "IMGPROXY_CROP_MAX_HEIGHT")
390-
391386
configurators.Patterns(&AllowedSources, "IMGPROXY_ALLOWED_SOURCES")
392387

393388
configurators.Bool(&SanitizeSvg, "IMGPROXY_SANITIZE_SVG")

processing/prepare.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package processing
33
import (
44
"math"
55

6-
"github.com/imgproxy/imgproxy/v3/config"
76
"github.com/imgproxy/imgproxy/v3/imagedata"
87
"github.com/imgproxy/imgproxy/v3/imagetype"
98
"github.com/imgproxy/imgproxy/v3/imath"
@@ -46,15 +45,6 @@ func calcScale(width, height int, po *options.ProcessingOptions, imgtype imagety
4645
var wshrink, hshrink float64
4746

4847
srcW, srcH := float64(width), float64(height)
49-
50-
if config.CropMaxWidth > 0 && srcW > float64(config.CropMaxWidth) {
51-
po.Width = config.CropMaxWidth
52-
}
53-
54-
if config.CropMaxHeight > 0 && srcH > float64(config.CropMaxHeight) {
55-
po.Height = config.CropMaxHeight
56-
}
57-
5848
dstW, dstH := float64(po.Width), float64(po.Height)
5949

6050
if po.Width == 0 {

0 commit comments

Comments
 (0)