当前位置:网站首页>[play with Huawei cloud] Huawei cloud zero code development image compression tool
[play with Huawei cloud] Huawei cloud zero code development image compression tool
2022-06-09 18:03:00 【Hua Weiyun】
1. Preface
Register Huawei cloud account 、 Real name authentication
If you have a Huawei account and have passed the real name authentication , Can directly experience .
If the account has not passed the real name authentication , please Register Huawei account number , Then finish Real name authentication ( Recommended “ Code scanning authentication ” The way , Immediate completion ). Reference resources How to real name authentication and How to scan code for authentication .
2. Resources to prepare
2.1 establish OBS bucket
step 1 Sign in Object storage service console , single click “ Creating buckets ”, Get into “ Creating buckets ” Interface .
You need to create two OBS bucket , It is used to save the pictures uploaded by the user and the compressed pictures .

step 2 Create two OBS Source bucket “picture-input2” Used to upload pictures ; Target bucket “picture-output2”, Store the output picture OBS bucket .


step 3 If you are prompted that the bucket name is duplicate , It can be changed by the user , And remember the bucket names corresponding to the upload bucket and the output bucket , For subsequent processes .
The creation is complete .

step 4 After the bucket is created ,OBS The bucket list has two buckets .
2.2 Create delegation
1) Sign in Unified identity authentication service console , single click “ Create delegation ”.

2) Start configuring delegates , The details are as follows . Configure delegation

3) Click next to select “Tenant Administrator” jurisdiction ( Users with this permission can perform arbitrary operations on all cloud resources owned by the enterprise ), Because the permission list is long , It is recommended that users search and match in the upper right search box .

4) Click next after checking permission , Select the scope of authority according to business needs and click OK , The delegate is now created ( Wait after the delegate is created 15-30 Minutes to take effect ).

2.3 Create a function
When building functions , You must select a delegate that contains OBS Delegation of access rights , Otherwise you can't use it OBS service .
step 1 Sign in Function workflow console , choice “ Function templates ”. On the function template page , Search for “obs The compressed image ”.

step 2 Fill in the function configuration information
1) Basic information configuration

2) Environment variable configuration

explain :
key obs_address The format of the value is obs.{region}.myhuaweicloud.com,region Value , Please refer to Regions and terminal nodes .
key ThumbnailBucket Value is the name of the output bucket you created .
3) Complete function creation
4) stay “ Set up ” Tab , Configure memory and timeout

2.4 Add dependency
The user enters the function details page , stay “ Code ” Tab , single click “ add to ”, Add the dependent package shown in the figure below , There are many dependent packages , It is recommended that the search box at the top right search for a match , Click OK... When the addition is complete , And click save... At the top right of the page .

2.5 establish OBS trigger
step 1 Set the tab in the navigation bar , Click in the upper left corner to create the trigger , Create trigger .

3. The test results
Sign in Object storage service console , Click the bucket name to enter picture-input bucket , And click the left navigation bar “ object ” Button to enter the object interface , Click on “ Upload object ”, Upload an optional picture ( Note that the picture name cannot contain Chinese and Chinese symbols ), The example uses picture.jpg.

Get into picture-output Bucket object interface , You can see the compressed picture resize-picture.jpg, The size of the picture is 1.28KB, Realize the compression of pictures .

边栏推荐
- NLP - Keyword Extraction - textrank
- 导电滑环的预期寿命是什么
- Arm instruction set review | basic instruction usage
- Epigentek Hi-Fi cDNA 合成试剂盒说明书
- Solve the chrome prompt: "your connection is not a private connection" and there is no continue access option
- 【数据处理】pandas读取sql数据
- 秒云云原生信创全兼容解决方案,推动信创产业加速落地
- Application of die cutting products in different fields
- NLP- 关键词提取 - 综述
- Mediapipe body and hand key points
猜你喜欢

Traversal and cueing of binary tree
![[long time series prediction] time series decomposition of [2] model components for detailed explanation of aotoformer code](/img/27/132ff1e68e9e34a9d50f1a5c3f4a2d.png)
[long time series prediction] time series decomposition of [2] model components for detailed explanation of aotoformer code

AI chief architect 3-aica-ai application practice in smart city

Arm instruction set review | basic instruction usage

导电滑环的预期寿命是什么

解决Chrome提示:“您的连接不是私密连接“,且无继续访问选项问题

UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xad in position 2: illegal multibyte sequence

Running the code, I want to add a progress bar to see the running progress of the following code in real time. How can I break it?

redis源码学习-03_动态字符串SDS

Side B of the charging pile is Not only official account? And smart charging applet!
随机推荐
Unity-代码绑定按钮功能
AI chief architect 3-aica-ai application practice in smart city
刷脸认证如何实现人脸又快又准完成校验?
Macro definition CV with parameters in opencv_ Role of assert()
微信小程序根据经纬度获取省市区信息
Ali's 10-year Technician: seven ways of thinking of the leader
Word使用技巧
入驻快讯|欢迎XCHARGE智充科技正式入驻 InfoQ 写作平台!
OpenCV的imshow()查看图片的像素值
Welcome to the InfoQ writing platform!
sqllite create a database
[data processing] pandas reads SQL data
Side B of the charging pile is Not only official account? And smart charging applet!
redis源码学习-03_动态字符串SDS
【玩转华为云】基于华为云图像识别标签实战
Android caching mechanism lrucache
Moco -Momentum Contrast for Unsupervised Visual Representation Learning
NLP- 关键词提取 - 综述
Development and practice of the martyr's family search system
What are the main applications of conductive slip rings