|Basic image processing service||Scaling||Proportional scaling, scaling image to target width and height, and more|
|Cropping||Cut (regular cropping), crop (scaling and cropping), iradius (inscribed circle cropping), and scrop (smart cropping)|
|Rotation||Adaptive rotation and common rotation|
|Format conversion||Format conversion, GIF optimization, and progressive display|
|Quality conversion||Changes the quality of images in JPG and WEBP formats|
|Gaussian blur||Blurs images|
|Watermarking||Image watermarks, text watermarks|
|Obtaining image information||Basic information, EXIF data, average hue|
|Removing metadata||Includes EXIF data|
|Quick thumbnail template||Performs quick format conversion, scaling, and cropping to generate thumbnails|
|Setting style||Sets image styles to easily manage images for different purposes|
For the parameters and method descriptions of all the APIs in the SDK, please see SDK API Reference.
The following example shows how COS automatically processes an image when you upload it.
Upon successful upload, COS will save both the original and processed images. You can obtain the processing result using a common download request.
List<PicOperationRule> rules = new LinkedList<>(); // Add a rule to convert the image to PNG format, and the resulting image will be saved in a bucket with a location identifier in the format: // examplepngobject rules.add(new PicOperationRule("examplepngobject", "imageView2/format/png")); PicOperations picOperations = new PicOperations(true, rules); PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, cosPath, srcPath); putObjectRequest.setPicOperations(picOperations); // If the upload is successful, you will get both the original and the processed images COSXMLUploadTask cosxmlUploadTask = transferManager.upload(bucket, cosPath, srcPath, uploadId);
For the complete sample, go to GitHub.