mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
minor refactoring: using default scale from default options
This commit is contained in:
@@ -24,7 +24,7 @@ For instance:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/thecodingmachine/gotenberg.git
|
$ git clone https://github.com/thecodingmachine/gotenberg.git
|
||||||
$ make publish GOTENBERG_USER_GID=your_custom_gid GOTENBERG_USER_UID=your_custom_uid DOCKER_REGISTRY=your_registry DOCKER_USER=registry_user DOCKER_PASSWORD=registry_password VERSION=6.1.0
|
$ make publish GOTENBERG_USER_GID=your_custom_gid GOTENBERG_USER_UID=your_custom_uid DOCKER_REGISTRY=your_registry DOCKER_USER=registry_user DOCKER_PASSWORD=registry_password VERSION=6.2.0
|
||||||
```
|
```
|
||||||
|
|
||||||
> `master` branch is always up-to-date with the latest version of the API.
|
> `master` branch is always up-to-date with the latest version of the API.
|
||||||
|
|||||||
@@ -302,18 +302,13 @@ func GoogleChromeRpccBufferSizeArg(r Resource, config conf.Config) (int64, error
|
|||||||
/*
|
/*
|
||||||
ScaleArg is a helper for retrieving
|
ScaleArg is a helper for retrieving
|
||||||
the "scale" argument as float64.
|
the "scale" argument as float64.
|
||||||
|
|
||||||
It also validates it against the application
|
|
||||||
configuration.
|
|
||||||
*/
|
*/
|
||||||
func ScaleArg(r Resource, config conf.Config) (float64, error) {
|
func ScaleArg(r Resource, config conf.Config) (float64, error) {
|
||||||
const (
|
const op string = "resource.ScaleArg"
|
||||||
op string = "resource.ScaleArg"
|
opts := printer.DefaultChromePrinterOptions(config)
|
||||||
defaultScale float64 = 1.0
|
|
||||||
)
|
|
||||||
result, err := r.Float64Arg(
|
result, err := r.Float64Arg(
|
||||||
ScaleArgKey,
|
ScaleArgKey,
|
||||||
defaultScale,
|
opts.Scale,
|
||||||
xassert.Float64NotInferiorTo(0.1),
|
xassert.Float64NotInferiorTo(0.1),
|
||||||
xassert.Float64NotSuperiorTo(2.0),
|
xassert.Float64NotSuperiorTo(2.0),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user