Service | Feature | Description |
Basic Image Processing | 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 |
String bucketName = "examplebucket-1250000000";String key = "qrcode.png";GetObjectRequest getObj = new GetObjectRequest(bucketName, key);// Scale the width and height to 50% of the original image.String rule = "imageMogr2/thumbnail/!50p";getObj.putCustomQueryParameter(rule, null);cosClient.getObject(getObj, new File("qrcode-50p.png"));
String bucketName = "examplebucket-1250000000";String key = "qrcode.png";GetObjectRequest getObj = new GetObjectRequest(bucketName, key);// Crop the radius of an inscribed circle to an integer greater than 0 and less than half of the shorter side of the original image. The center of the inscribed circle is the center of the image.String rule = "imageMogr2/iradius/150";getObj.putCustomQueryParameter(rule, null);cosClient.getObject(getObj, new File("qrcode-cropping.png"));
String bucketName = "examplebucket-1250000000";String key = "qrcode.png";GetObjectRequest getObj = new GetObjectRequest(bucketName, key);// Rotate 90 degrees clockwiseString rule = "imageMogr2/rotate/90";getObj.putCustomQueryParameter(rule, null);cosClient.getObject(getObj, new File("qrcode-rotate.png"));
String bucketName = "examplebucket-1250000000";String key = "qrcode.png";GetObjectRequest getObj = new GetObjectRequest(bucketName, key);// Obtaining image's average hueString rule = "imageAve";COSObject object = cosClient.getObject(getObj);COSObjectInputStream objectContent = object.getObjectContent();
String bucketName = "examplebucket-1250000000";String key = "qrcode.png";GetObjectRequest getObj = new GetObjectRequest(bucketName, key);// Basic image informationString rule = "imageInfo";getObj.putCustomQueryParameter(rule, null);COSObject object = cosClient.getObject(getObj);COSObjectInputStream objectContent = object.getObjectContent();
Was this page helpful?