tencent cloud

Feedback

Basic Image Processing

Last updated: 2024-02-29 16:13:43

    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
    Proportional scaling, scaling image to target width and height
    Regular cropping, cropping and scaling, cropping to circle, smart face cropping
    Adaptive rotation, regular rotation
    Format conversion, GIF format optimization, progressive display
    Quality change for JPG and WebP images
    Image blurring
    Image sharpening
    Watermarking
    Image information acquisition
    Including EXIF information
    Quick image format conversion, scaling, and cropping for thumbnail generation
    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