The four arguments are the scaling numbers that describe the bounding box
that will crop the image. The upper left point of the bounding box will be at
(left_x*image_width, top_y*image_height), and the lower right point will
be at (right_x*image_width, bottom_y*image_height).
Args
image_data
String of the source image data.
left_x
Float value between 0.0 and 1.0, inclusive.
top_y
Float value between 0.0 and 1.0, inclusive.
right_x
Float value between 0.0 and 1.0, inclusive.
bottom_y
Float value between 0.0 and 1.0, inclusive.
output_encoding
A value from OUTPUT_ENCODING_TYPES.
quality
A value between 1 and 100 to specify the quality of the encoding.
This value is only used to control JPEG quality.
correct_orientation
A value from ORIENTATION_CORRECTION_TYPE to indicate
if orientation correction should be performed during the transformation.
rpc
An optional UserRPC object.
transparent_substitution_rgb
When transparent pixels are not supported in
the destination image format, then transparent pixels will be substituted
for the specified color, which must be in 32-bit RGB format.
Returns
A UserRPC object; call get_result() to complete the RPC and obtain the
crop result.
Raises
TypeError
If the args are not of type float.
BadRequestError
When the bounding box values are invalid.
Error
All other errors. See Image.ExecuteTransforms for more details.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-09-30 UTC."],[[["This function, `crop_async`, asynchronously crops an image using specified bounding box coordinates."],["The bounding box is defined by four float values (`left_x`, `top_y`, `right_x`, `bottom_y`), each ranging from 0.0 to 1.0, representing relative positions within the image."],["The function accepts arguments like `output_encoding`, `quality`, `correct_orientation`, and `transparent_substitution_rgb` to control the output and the transformation of the image."],["It returns a `UserRPC` object, which requires `get_result()` to complete the operation and retrieve the cropped image."],["It can raise `TypeError` if bounding box inputs are not floats, `BadRequestError` for invalid bounding boxes, or a general `Error` for other issues."]]],[]]