parseImageTypes parses a comma-separated list of image format names and returns a slice of imagetype.Type values.
(env string)
| 121 | // parseImageTypes parses a comma-separated list of image format names and returns |
| 122 | // a slice of imagetype.Type values. |
| 123 | func parseImageTypes(env string) ([]imagetype.Type, error) { |
| 124 | parts := strings.Split(env, ",") |
| 125 | result := make([]imagetype.Type, 0, len(parts)) |
| 126 | |
| 127 | for _, p := range parts { |
| 128 | part := strings.TrimSpace(p) |
| 129 | t, ok := imagetype.GetTypeByName(part) |
| 130 | if !ok { |
| 131 | return nil, fmt.Errorf("unknown image format: %s", part) |
| 132 | } |
| 133 | result = append(result, t) |
| 134 | } |
| 135 | |
| 136 | return result, nil |
| 137 | } |
| 138 | |
| 139 | // parseImageTypesQuality parses format=quality pairs (e.g., "jpg=80,webp=90") and returns |
| 140 | // a map of image types to their quality values (1-100). |
nothing calls this directly
no test coverage detected