tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Basic Image Processing

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2024-01-06 15:14:56

Overview

This document describes how to use COS Image Processing in the console, with the following two methods available for you. For more information on image processing, see Image Processing Overview.
Adding parameters to an image URL: You can process an image by adding parameters after the object URL of the image.
Using an image style: You can save different processing results by creating styles, and use such styles to standardize your image processing. The style created is an assembled template designed to process parameters in real time when an image is downloaded.
Note:
Image Processing is available only in public cloud regions.
Image Processing is charged by CI. For detailed pricing, see Basic image processing fee in Billing and Pricing.

Adding URL parameters

1. Log in to the COS Console.
2. Locate the bucket that stores the image, and click the bucket name to enter the bucket management page.
3. Click Details in the Operation column for the image to enter its details page.
4. Copy the Object URL and paste it into the address bar of your browser.
Note:
To process an image, you need the write permission on objects. For object permissions setting, see Setting Object Access Permission.
5. In your address bar, add parameters after the object URL using the format below. For more image processing parameters and instructions, see the Cloud Infinite API documentation Basic Image Processing.
Object URL?processing API name/processing operation name/processing parameter
Note:
If the access permission on the image file is private-read, you need to add image processing parameters to the signed address.
Example: scaling an image to 50% of its original size Suppose that the original image is displayed as below, the access permissions on the object are public read and private write, and the object URL is https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/sample.jpeg.
img

Next, add the following parameters to the URL:
Scaling API: imageMogr2
Scaling operation name: thumbnail
Processing parameter: !50p
Now, you obtain a new URL with added parameters https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/sample.jpeg?imageMogr2/thumbnail/!50p. Paste this URL to your address bar, press Enter, and you will see a scaled image as shown below:


Using an image style

Image Style can help you present different processing parameters in the format of template to standardize your image processing. The style created is an assembled template designed to process parameters in real time when an image is downloaded. Now, let’s take Image Style: width: 480px, height: 270px as an example, and introduce how to use this feature:
1. Log in to the COS console.
2. Locate the bucket that stores the image, and click the bucket name to enter the bucket management page.
3. In the left menu bar, click Data Processing > Image Processing to enter the Style Management section. Separator: Style separators are symbols that separate filenames and processing styles, including -, _, /, and !. Select ! here and save.
4. Click Add Styles and set fields as follows:
Style Name: Enter your custom style name, such as “yunstyle”.
Note:
Note that style names are case-sensitive and cannot be modified once saved.
For the purpose of clarity, the separator you have enabled cannot appear in the style name.
Editing Mode: Select Basic.
Resize Mode: Select Scale-only.
Scaling: Select Fixed height and width.
Size: width: 480px, height: 270px.
Progressive Display: Once enabled, the images you access will be displayed progressively. It is disabled by default. Retain the default setting here.
Output: Choose a format of the output image. Retain the default value Original here.
5. Once your configuration is done, You can click the Preview button on the right for preview.
6. After the preview, click Save, and you will see that an image style named “yunstyle” has been added.
Note:
Up to 100 styles can be set for a single bucket.
The settings take effect in 30 minutes on average.
Changing a separator requires clearing the cache. It takes at least 24 hours for separator changes to take effect globally.
Canceling a separator used may cause product feature malfunctions.
For more information on image styles, see Setting Styles.
7. Go to the object details page, copy the object URL, and enter your separator and style name after the URL in the following format:
Object URL + Separator + Processing style name
Now, you can obtain a final object URL https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/sample.jpeg!yunstyle. Paste it to your address bar, press Enter, and you will see a scaled image shown as below:

If you need to set a signature for the styled image, change the URL to https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/sample.jpeg!yunstyle?q-sign-algorithm=<signature>, and use /sample.jpg!yunstyle as the resource to calculate the signature <signature>.

Ajuda e Suporte

Esta página foi útil?

comentários