|
@@ -58,6 +58,23 @@ func boolEnvConfig(b *bool, name string) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func imageTypesEnvConfig(it *[]imageType, name string) {
|
|
|
|
+ *it = []imageType{}
|
|
|
|
+
|
|
|
|
+ if env := os.Getenv(name); len(env) > 0 {
|
|
|
|
+ parts := strings.Split(env, ",")
|
|
|
|
+
|
|
|
|
+ for _, p := range parts {
|
|
|
|
+ pt := strings.TrimSpace(p)
|
|
|
|
+ if t, ok := imageTypes[pt]; ok {
|
|
|
|
+ *it = append(*it, t)
|
|
|
|
+ } else {
|
|
|
|
+ logWarning("Unknown image format to skip: %s", pt)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
func hexEnvConfig(b *[]securityKey, name string) error {
|
|
func hexEnvConfig(b *[]securityKey, name string) error {
|
|
var err error
|
|
var err error
|
|
|
|
|
|
@@ -187,6 +204,8 @@ type config struct {
|
|
EnforceWebp bool
|
|
EnforceWebp bool
|
|
EnableClientHints bool
|
|
EnableClientHints bool
|
|
|
|
|
|
|
|
+ SkipProcessingFormats []imageType
|
|
|
|
+
|
|
UseLinearColorspace bool
|
|
UseLinearColorspace bool
|
|
DisableShrinkOnLoad bool
|
|
DisableShrinkOnLoad bool
|
|
|
|
|
|
@@ -329,6 +348,8 @@ func configure() error {
|
|
boolEnvConfig(&conf.EnforceWebp, "IMGPROXY_ENFORCE_WEBP")
|
|
boolEnvConfig(&conf.EnforceWebp, "IMGPROXY_ENFORCE_WEBP")
|
|
boolEnvConfig(&conf.EnableClientHints, "IMGPROXY_ENABLE_CLIENT_HINTS")
|
|
boolEnvConfig(&conf.EnableClientHints, "IMGPROXY_ENABLE_CLIENT_HINTS")
|
|
|
|
|
|
|
|
+ imageTypesEnvConfig(&conf.SkipProcessingFormats, "IMGPROXY_SKIP_PROCESSING_FORMATS")
|
|
|
|
+
|
|
boolEnvConfig(&conf.UseLinearColorspace, "IMGPROXY_USE_LINEAR_COLORSPACE")
|
|
boolEnvConfig(&conf.UseLinearColorspace, "IMGPROXY_USE_LINEAR_COLORSPACE")
|
|
boolEnvConfig(&conf.DisableShrinkOnLoad, "IMGPROXY_DISABLE_SHRINK_ON_LOAD")
|
|
boolEnvConfig(&conf.DisableShrinkOnLoad, "IMGPROXY_DISABLE_SHRINK_ON_LOAD")
|
|
|
|
|