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

Method applyResizeOption

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

Source from the content-addressed store, hash-verified

80}
81
82func (p *Parser) applyResizeOption(ctx context.Context, o *options.Options, args []string) error {
83 if err := p.ensureMaxArgs(ctx, "resize", args, 8); err != nil {
84 return err
85 }
86
87 if len(args[0]) > 0 {
88 if err := p.applyResizingTypeOption(ctx, o, args[0:1]); err != nil {
89 return err
90 }
91 }
92
93 if len(args) > 1 {
94 if err := p.applySizeOption(ctx, o, args[1:]); err != nil {
95 return err
96 }
97 }
98
99 return nil
100}
101
102func (p *Parser) applyZoomOption(ctx context.Context, o *options.Options, args []string) error {
103 if err := p.ensureMaxArgs(ctx, "zoom", args, 2); err != nil {

Callers 1

applyURLOptionMethod · 0.95

Calls 3

ensureMaxArgsMethod · 0.95
applySizeOptionMethod · 0.95

Tested by

no test coverage detected