Save resized image

This function resizes a specified image.

Important:

When you disable the WebServer role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
height
required
integer >= 1

The height to which to set the image size.

Example: height=300
image_file
required
string

The name of the file to scale.

Note:

Use the absolute filepath or a filepath relative to the user's home directory.

Example: image_file=/images/image.jpg
width
required
integer >= 1

The width to which to set the image size.

Example: width=200
save_original_as
string

The path to the directory in which to save a copy the original image file.

Note:

  • If you don't pass this parameter, the function doesn't save a copy of the original image.
  • Use the absolute filepath or a filepath relative to the user's home directory.
Example: save_original_as=images/original.jpg
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/ImageManager/resize_image
Request samples
uapi --output=jsonpretty \
  --user=username \
  ImageManager \
  resize_image \
  image_file='images/image.jpg' \
  width='200' \
  height='300'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "resize_image",
  • "module": "ImageManager",
  • "result": {
    • "data": "/home/cptest1/images/myimage.jpg",
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}