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

Method applySkipProcessingFormatsOption

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

Source from the content-addressed store, hash-verified

410}
411
412func (p *Parser) applySkipProcessingFormatsOption(ctx context.Context, o *options.Options, args []string) error {
413 for _, format := range args {
414 if f, ok := imagetype.GetTypeByName(format); ok {
415 options.AppendToSlice(o, keys.SkipProcessing, f)
416 } else {
417 return newOptionArgumentError(
418 ctx,
419 keys.SkipProcessing,
420 "Invalid image format in %s: %s",
421 keys.SkipProcessing,
422 format,
423 )
424 }
425 }
426
427 return nil
428}
429
430func (p *Parser) applyRawOption(ctx context.Context, o *options.Options, args []string) error {
431 return p.parseBool(ctx, o, keys.Raw, args...)

Callers 1

applyURLOptionMethod · 0.95

Calls 3

GetTypeByNameFunction · 0.92
AppendToSliceFunction · 0.92
newOptionArgumentErrorFunction · 0.85

Tested by

no test coverage detected