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

Method applyFlipOption

options/parser/apply.go:237–255  ·  view source on GitHub ↗
(ctx context.Context, o *options.Options, args []string)

Source from the content-addressed store, hash-verified

235}
236
237func (p *Parser) applyFlipOption(ctx context.Context, o *options.Options, args []string) error {
238 if err := p.ensureMaxArgs(ctx, "flip", args, 2); err != nil {
239 return err
240 }
241
242 if len(args[0]) > 0 {
243 if err := p.parseBool(ctx, o, keys.FlipHorizontal, args[0]); err != nil {
244 return err
245 }
246 }
247
248 if len(args) > 1 && len(args[1]) > 0 {
249 if err := p.parseBool(ctx, o, keys.FlipVertical, args[1]); err != nil {
250 return err
251 }
252 }
253
254 return nil
255}
256
257func (p *Parser) applyQualityOption(ctx context.Context, o *options.Options, args []string) error {
258 return p.parseQualityInt(ctx, o, keys.Quality, 0, args...)

Callers 1

applyURLOptionMethod · 0.95

Calls 2

ensureMaxArgsMethod · 0.95
parseBoolMethod · 0.95

Tested by

no test coverage detected