mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-29 04:53:05 +02:00
Rearrange processing options
This commit is contained in:
@@ -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.
|
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
|
### Quality
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -706,6 +697,15 @@ Defines a filename for the `Content-Disposition` header. When not specified, img
|
|||||||
|
|
||||||
Default: empty
|
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
|
### Preset
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@@ -88,7 +88,6 @@ type ProcessingOptions struct {
|
|||||||
StripColorProfile bool
|
StripColorProfile bool
|
||||||
AutoRotate bool
|
AutoRotate bool
|
||||||
EnforceThumbnail bool
|
EnforceThumbnail bool
|
||||||
ReturnAttachment bool
|
|
||||||
|
|
||||||
SkipProcessingFormats []imagetype.Type
|
SkipProcessingFormats []imagetype.Type
|
||||||
|
|
||||||
@@ -101,7 +100,8 @@ type ProcessingOptions struct {
|
|||||||
PreferAvif bool
|
PreferAvif bool
|
||||||
EnforceAvif bool
|
EnforceAvif bool
|
||||||
|
|
||||||
Filename string
|
Filename string
|
||||||
|
ReturnAttachment bool
|
||||||
|
|
||||||
UsedPresets []string
|
UsedPresets []string
|
||||||
|
|
||||||
@@ -916,8 +916,6 @@ func applyURLOption(po *ProcessingOptions, name string, args []string) error {
|
|||||||
return applyStripColorProfileOption(po, args)
|
return applyStripColorProfileOption(po, args)
|
||||||
case "enforce_thumbnail", "eth":
|
case "enforce_thumbnail", "eth":
|
||||||
return applyEnforceThumbnailOption(po, args)
|
return applyEnforceThumbnailOption(po, args)
|
||||||
case "return_attachment", "att":
|
|
||||||
return applyReturnAttachmentOption(po, args)
|
|
||||||
// Saving options
|
// Saving options
|
||||||
case "quality", "q":
|
case "quality", "q":
|
||||||
return applyQualityOption(po, args)
|
return applyQualityOption(po, args)
|
||||||
@@ -936,6 +934,8 @@ func applyURLOption(po *ProcessingOptions, name string, args []string) error {
|
|||||||
return applyExpiresOption(po, args)
|
return applyExpiresOption(po, args)
|
||||||
case "filename", "fn":
|
case "filename", "fn":
|
||||||
return applyFilenameOption(po, args)
|
return applyFilenameOption(po, args)
|
||||||
|
case "return_attachment", "att":
|
||||||
|
return applyReturnAttachmentOption(po, args)
|
||||||
// Presets
|
// Presets
|
||||||
case "preset", "pr":
|
case "preset", "pr":
|
||||||
return applyPresetOption(po, args)
|
return applyPresetOption(po, args)
|
||||||
|
Reference in New Issue
Block a user