All Products
Search
Document Center

Intelligent Media Management:CreateImageSplicingTask

Last Updated:Dec 11, 2024

Creates an image splicing task. You can call this operation to splice multiple images into one based on a given rule and save the final image into an Object Storage Service (OSS) bucket.

Operation description

  • Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).****
  • Make sure that the project that you want to use exists in the current region. For more information, see Project management.
  • You can call this operation to splice up to eight images. Each side of an image cannot exceed 32,876 pixels, and the total number of pixels of the image cannot exceed 1 billion.
  • The CreateImageSplicingTask operation is an asynchronous operation. After a task is executed, the task information is saved only for seven days. When the retention period elapses, the task information is no longer retrievable. You can call the GetTask or ListTasks to query information about the task.`` If you specify Notification , you can also obtain information about the task based on notifications.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
imm:CreateImageSplicingTaskcreate
*Project
acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project. You can obtain the name of the project from the response of the CreateProject operation.

test-project
Sourcesarray<object>Yes

The input images. The images are sliced in the order of the input image URIs.

objectYes

The input image.

URIstringYes

The Object Storage Service (OSS) bucket in which you store the input images.

Specify the value in the oss://${Bucket}/${Object} format. ${Bucket} specifies the name of the OSS bucket that resides in the same region as the current project. ${Object} specifies the complete path to the input images that have an extension.

The following image formats are supported: jpg and png.

oss://examplebucket/sampleobject.jpg
RotatelongNo

The rotation angle. Valid values:

  • 0 (default)
  • 90
  • 180
  • 270
90
TargetURIstringYes

The OSS bucket in which you want to store the output image.

Specify the value in the oss://${bucketname}/${objectname} format. ${bucketname} specifies the name of the OSS bucket that resides in the same region as the current project. ${objectname} specifies the path to the output image.

oss://examplebucket/outputImage.jpg
ImageFormatstringNo

The compression format of the output image. Valid values:

  • jpg (default)
  • png
  • webp
jpg
QualitylongNo

The compression quality of the output image. This parameter takes effect only for JPG and WebP images. Valid values: 0 to 100. Default value: 80.

80
DirectionstringNo

The splicing method. Valid values:

  • vertical (default): All input images are vertically aligned and have the same width.
  • horizontal: All input images are horizontally aligned and have the same height.
vertical
ScaleTypestringNo

The scaling mode of the input images that are vertically or horizontally aligned. Valid values:

  • fit (default): Input images are scaled proportionally, and black edges are not retained.
  • stretch: Input images are stretched to fill the space.
  • horizon: Input images are horizontally stretched.
  • vertical: Input images are vertically stretched.
stretch
AlignlongNo

The width or height with which the input images must align. Valid values: 1 to 4096. Unit: px.

  • If you set Direction to vertical, this parameter specifies the width with which the input images must align.
  • If you set Direction to horizontal, this parameter specifies the height with which the input images must align.
Note If you do not specify this parameter, the width or height of the first input image is used.
192
PaddinglongNo

The space between component images in the output image. Default value: 0. Unit: px.

2
MarginlongNo

The empty space or border around the edges of the output image. Default value: 0. Unit: px.

2
BackgroundColorstringNo

The padding color of the spaces specified by Padding and Margin. Colors encoded in the #FFFFFF format and colors that are related to preset keywords such as red and alpha are supported.

red
UserDatastringNo

The user data, which is returned as asynchronous notifications to help manage notifications within your system. The maximum length of the user data is 2,048 bytes.

test-data
CredentialConfigCredentialConfigNo

The authorization chain. For more information, see Use authorization chains to access resources of other entities.

TagsobjectNo

The custom tags. You can search for or filter asynchronous tasks by custom tag.

{ "User": "Jane" }
NotificationNotificationNo

The notification settings. For more information, click Notification. For information about the asynchronous notification format, see Asynchronous notification format.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

94D6F994-E298-037E-8E8B-0090F27*****
EventIdstring

The event ID.

10C-1R6p7Km0H5Ieg38LKXTIvw*****
TaskIdstring

The task ID.

ImageSplicing-537cc157-7645-444a-a631-c8db4d02*****

Examples

Sample success responses

JSONformat

{
  "RequestId": "94D6F994-E298-037E-8E8B-0090F27*****",
  "EventId": "10C-1R6p7Km0H5Ieg38LKXTIvw*****",
  "TaskId": "ImageSplicing-537cc157-7645-444a-a631-c8db4d02*****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-03The request parameters of the API has changedView Change Details
2023-03-09The request parameters of the API has changedView Change Details
2022-08-16The request parameters of the API has changedView Change Details
2022-08-16The request parameters of the API has changedView Change Details