4 functions, invoked through the cpanel_uapi tool.
scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="ImageManager", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.
This function creates thumbnails from images. The function saves the new thumbnail images in a thumbnails subdirectory inside the original directory. The system prepends thumbnail filenames with `tn_ (for example, tn_picture.jpg`).
Important:
When you disable the WebServer role, the system disables this function.
dirstringRequired
The path to the directory where the image resides. When you pass this parameter, the function creates a thumbnail directory directly below the image directory. NOTE: This parameter can use an absolute directory path or a path relative to the user's home directory.
height_percentageintegerRequired
The percentage by which to reduce the thumbnails' height.
width_percentageintegerRequired
The percentage by which to reduce the thumbnails' width.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
failedinteger
Whether the function failed to create the thumbnail file. Note: The function only returns this value if it doesn't create the thumbnail. 1 is the only possible value.
One of: 1
filestring
The file from which the function generated the thumbnail file. An absolute filepath.
reasonstring
The reason that the function didn't create the thumbnail file. Note: The function only returns this value if it doesn't create the thumbnail.
thumbnail_filestring
The thumbnail file that the function generated. An absolute filepath.
When you disable the WebServer role, the system disables this function.
heightintegerRequired
The height to which to set the image size.
image_filestringRequired
The name of the file to scale. Note: Use the absolute filepath or a filepath relative to the user's home directory.
widthintegerRequired
The width to which to set the image size.
save_original_asstringOptional
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.
Response — normalized as { ok, data, errors[], warnings[] }; data contains: