Browse Source

Rearrange processing options

DarthSim 2 years ago
parent
commit
8a081a917e
2 changed files with 13 additions and 13 deletions
  1. 9 9
      docs/generating_the_url.md
  2. 4 4
      options/processing_options.go

+ 9 - 9
docs/generating_the_url.md

@@ -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
 
 ```

+ 4 - 4
options/processing_options.go

@@ -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)