MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / NewDefaultConfig

Function NewDefaultConfig

processing/config.go:52–75  ·  view source on GitHub ↗

NewDefaultConfig creates a new Config instance with the given parameters.

()

Source from the content-addressed store, hash-verified

50
51// NewDefaultConfig creates a new Config instance with the given parameters.
52func NewDefaultConfig() Config {
53 return Config{
54 WatermarkOpacity: 1,
55 PreferredFormats: []imagetype.Type{
56 imagetype.JPEG,
57 imagetype.PNG,
58 imagetype.GIF,
59 },
60 Quality: 80,
61 FormatQuality: map[imagetype.Type]int{
62 imagetype.WEBP: 79,
63 imagetype.AVIF: 63,
64 imagetype.JXL: 77,
65 },
66 StripMetadata: true,
67 KeepCopyright: true,
68 StripColorProfile: true,
69 AutoRotate: true,
70 EnforceThumbnail: false,
71 PreserveHDR: false,
72
73 Svg: svg.NewDefaultConfig(),
74 }
75}
76
77// LoadConfigFromEnv creates a new Config instance with the given parameters.
78func LoadConfigFromEnv(c *Config) (*Config, error) {

Callers 1

NewDefaultConfigFunction · 0.92

Calls 1

NewDefaultConfigFunction · 0.92

Tested by

no test coverage detected