tencent cloud

Feedback

Basic Image Processing

Last updated: 2022-07-25 16:03:32

    Overview

    COS has integrated Cloud Infinite (CI), a one-stop professional multimedia solution that offers the image processing features as outlined below. For more information, see Image Processing Overview.

    Service Feature Description
    Basic image processing Scaling Proportional scaling, scaling image to target width and height
    Cropping Regular cropping, cropping and scaling, cropping to circle, smart face cropping
    Rotation Adaptive rotation, regular rotation
    Format conversion Format conversion, GIF format optimization, progressive display
    Quality change Quality change for JPG and WebP images
    Gaussian blurring Image blurring
    Sharpening Image sharpening
    Watermarking Image watermark, text watermark
    Image information acquisition Basic information, EXIF information, average hue
    Metadata removal Including EXIF information
    Quick thumbnail template Quick image format conversion, scaling, and cropping for thumbnail generation
    Style configuration Image style configuration for easy image management

    Basic Image Processing

    Scaling

    Feature description

    Proportional scaling, scaling image to target width and height, etc.

    Method prototype

    CosResult GetObject(const GetObjectByFileReq& request, GetObjectByFileResp* response);
    

    Sample request

    qcloud_cos::CosConfig config("./config.json");
    qcloud_cos::CosAPI cos(config);
    std::string bucket_name = "examplebucket-1250000000";
    qcloud_cos::GetObjectByFileReq req(bucket_name, object_name, local_file);
    // Scale an image to 50% of its original width and height
    req.AddParam("imageMogr2/thumbnail/!50p", "");
    qcloud_cos::GetObjectByFileResp resp;
    qcloud_cos::CosResult result = cos.GetObject(req, &resp);
    if (result.IsSucc()) {
     // The call is successful. You can call the `resp` member functions to get the return content.
    } else {
     // The call failed. You can call the `result` member functions to get the error information.
    } 
    

    Parameter description

    Parameter Description Type Required
    req GetObject operation request GetObjectByFileReq Yes
    resp GetObject operation response GetObjectByFileResp Yes

    Cropping

    Feature description

    Similar to the scaling operation.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support