NewDefaultConfig creates a new Config instance with the given parameters.
()
| 50 | |
| 51 | // NewDefaultConfig creates a new Config instance with the given parameters. |
| 52 | func 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. |
| 78 | func LoadConfigFromEnv(c *Config) (*Config, error) { |
no test coverage detected