Service | Feature | Description |
Image Processing-Basic Services | Proportional scaling, scaling image to target width and height, and more | |
| Cut (regular cropping), crop (scaling and cropping), iradius (inscribed circle cropping), and scrop (smart cropping) | |
| Adaptive rotation and common rotation | |
| Format conversion, GIF optimization, and progressive display | |
| Changes the quality of images in JPG and WEBP formats | |
| Blurs images | |
| Sharpens images | |
| Watermarking | |
| Obtaining image information | |
| Includes EXIF data | |
| Performs quick format conversion, scaling, and cropping to generate thumbnails |
QCloudPutObjectWatermarkRequest* put = [QCloudPutObjectWatermarkRequest new];// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "video/xxx/movie.mp4"put.object = @"exampleobject";// Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucketput.bucket = @"examplebucket-1250000000";put.body = [@"123456789" dataUsingEncoding:NSUTF8StringEncoding];QCloudPicOperations * op = [[QCloudPicOperations alloc]init];// Indicate whether to return information of the original image. `0` (default): no; `1`: yesop.is_pic_info = NO;QCloudPicOperationRule * rule = [[QCloudPicOperationRule alloc]init];// Path of processing result file. If the path starts with `/`, the result file is stored in the specified folder. Otherwise, it is stored in the same directory as the input image file.rule.fileid = @"test";// Blind watermark text, which must be URL-safe Base64-encoded. This parameter is required if `type` is set to `3` and does not take effect if `type` is set to `1` or `2`.rule.text = @"123"; // The watermark text can only be a string of [a-z, A-Z, 0-9]// Blind watermark type. Valid values: `1` (semi-blind), `2` (perfectly blind), `3` (text)rule.type = QCloudPicOperationRuleText;op.rule = @[rule];put.picOperations = op;[put setFinishBlock:^(id outputObject, NSError *error) {}];[[QCloudCOSXMLService defaultCOSXML] PutWatermarkObject:put];
let put = QCloudPutObjectWatermarkRequest<AnyObject>();// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "video/xxx/movie.mp4"put.object = "exampleobject";// Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucketput.bucket = "examplebucket-1250000000";put.body = "123456789".data(using: .utf8)! as NSData;let op = QCloudPicOperations.init();// Indicate whether to return information of the original image. `0` (default): no; `1`: yesop.is_pic_info = false;let rule = QCloudPicOperationRule.init();// Path of processing result file. If the path starts with `/`, the result file is stored in the specified folder. Otherwise, it is stored in the same directory as the input image file.rule.fileid = "test";// Blind watermark text, which must be URL-safe Base64-encoded. This parameter is required if `type` is set to `3` and does not take effect if `type` is set to `1` or `2`.rule.text = "123";// Blind watermark type. Valid values: `1` (semi-blind), `2` (perfectly blind), `3` (text)rule.type = .text;op.rule = [rule];put.picOperations = op;put.setFinish { (outoutObject, error) in};QCloudCOSXMLService.defaultCOSXML().putWatermarkObject(put);
QCloudCICloudDataOperationsRequest* put = [QCloudCICloudDataOperationsRequest new];// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "video/xxx/movie.mp4"put.object = @"exampleobject";// Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucketput.bucket = @"examplebucket-1250000000";QCloudPicOperations * op = [[QCloudPicOperations alloc]init];// Indicate whether to return information of the original image. `0` (default): no; `1`: yesop.is_pic_info = NO;QCloudPicOperationRule * rule = [[QCloudPicOperationRule alloc]init];// Path of processing result file. If the path starts with `/`, the result file is stored in the specified folder. Otherwise, it is stored in the same directory as the input image file.rule.fileid = @"test";// Blind watermark text, which must be URL-safe Base64-encoded. This parameter is required if `type` is set to `3` and does not take effect if `type` is set to `1` or `2`.rule.text = @"123"; // The watermark text can only be a string of [a-z, A-Z, 0-9]// Blind watermark type. Valid values: `1` (semi-blind), `2` (perfectly blind), `3` (text)rule.type = QCloudPicOperationRuleText;op.rule = @[rule];put.picOperations = op;[put setFinishBlock:^(QCloudPutObjectWatermarkResult *outputObject, NSError *error) {}];[[QCloudCOSXMLService defaultCOSXML] CloudDataOperations:put];
let put = QCloudCICloudDataOperationsRequest<AnyObject>();// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "video/xxx/movie.mp4"put.object = "exampleobject";// Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucketput.bucket = "examplebucket-1250000000";let op = QCloudPicOperations.init();// Indicate whether to return information of the original image. `0` (default): no; `1`: yesop.is_pic_info = false;let rule = QCloudPicOperationRule.init();// Path of processing result file. If the path starts with `/`, the result file is stored in the specified folder. Otherwise, it is stored in the same directory as the input image file.rule.fileid = "test";// Blind watermark text, which must be URL-safe Base64-encoded. This parameter is required if `type` is set to `3` and does not take effect if `type` is set to `1` or `2`.rule.text = "123";// Blind watermark type. Valid values: `1` (semi-blind), `2` (perfectly blind), `3` (text)rule.type = .text;op.rule = [rule];put.picOperations = op;put.setFinish { (outoutObject, error) in};QCloudCOSXMLService.defaultCOSXML().cloudDataOperations(put);
Was this page helpful?