1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-07 11:36:25 +02:00

Rearrange processing options

This commit is contained in:
DarthSim 2022-09-05 16:55:38 +06:00
parent 88984c02c3
commit 8a081a917e
2 changed files with 13 additions and 13 deletions

View File

@ -529,15 +529,6 @@ eth:%enforce_thumbnail
When set to `1`, `t` or `true` and the source image has an embedded thumbnail, imgproxy will always use the embedded thumbnail instead of the main image. Currently, only thumbnails embedded in `heic` and `avif` are supported. This is normally controlled by the [IMGPROXY_ENFORCE_THUMBNAIL](configuration.md#miscellaneous) configuration but this procesing option allows the configuration to be set for each request.
### Return attachment
```
return_attachment:%return_attachment
att:%return_attachment
```
When set to `1`, `t` or `true`, imgproxy will return `attachment` in the `Content-Disposition` header, and the browser will open a 'Save as' dialog. This is normally controlled by the [IMGPROXY_RETURN_ATTACHMENT](configuration.md#miscellaneous) configuration but this procesing option allows the configuration to be set for each request.
### Quality
```
@ -706,6 +697,15 @@ Defines a filename for the `Content-Disposition` header. When not specified, img
Default: empty
### Return attachment
```
return_attachment:%return_attachment
att:%return_attachment
```
When set to `1`, `t` or `true`, imgproxy will return `attachment` in the `Content-Disposition` header, and the browser will open a 'Save as' dialog. This is normally controlled by the [IMGPROXY_RETURN_ATTACHMENT](configuration.md#miscellaneous) configuration but this procesing option allows the configuration to be set for each request.
### Preset
```

View File

@ -88,7 +88,6 @@ type ProcessingOptions struct {
StripColorProfile bool
AutoRotate bool
EnforceThumbnail bool
ReturnAttachment bool
SkipProcessingFormats []imagetype.Type
@ -101,7 +100,8 @@ type ProcessingOptions struct {
PreferAvif bool
EnforceAvif bool
Filename string
Filename string
ReturnAttachment bool
UsedPresets []string
@ -916,8 +916,6 @@ func applyURLOption(po *ProcessingOptions, name string, args []string) error {
return applyStripColorProfileOption(po, args)
case "enforce_thumbnail", "eth":
return applyEnforceThumbnailOption(po, args)
case "return_attachment", "att":
return applyReturnAttachmentOption(po, args)
// Saving options
case "quality", "q":
return applyQualityOption(po, args)
@ -936,6 +934,8 @@ func applyURLOption(po *ProcessingOptions, name string, args []string) error {
return applyExpiresOption(po, args)
case "filename", "fn":
return applyFilenameOption(po, args)
case "return_attachment", "att":
return applyReturnAttachmentOption(po, args)
// Presets
case "preset", "pr":
return applyPresetOption(po, args)