You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-11-29 23:07:40 +02:00
Move WebP enforcement/preference to processing
This commit is contained in:
@@ -497,11 +497,15 @@ func processImage(ctx context.Context) ([]byte, context.CancelFunc, error) {
|
||||
imgtype := getImageType(ctx)
|
||||
|
||||
if po.Format == imageTypeUnknown {
|
||||
if vipsTypeSupportSave[imgtype] {
|
||||
if po.PreferWebP && vipsTypeSupportSave[imageTypeWEBP] {
|
||||
po.Format = imageTypeWEBP
|
||||
} else if vipsTypeSupportSave[imgtype] {
|
||||
po.Format = imgtype
|
||||
} else {
|
||||
po.Format = imageTypeJPEG
|
||||
}
|
||||
} else if po.EnforceWebP && vipsTypeSupportSave[imageTypeWEBP] {
|
||||
po.Format = imageTypeWEBP
|
||||
}
|
||||
|
||||
if !vipsSupportSmartcrop {
|
||||
|
||||
Reference in New Issue
Block a user