Processing an Image by Editing Code
This case describes how to resize an image by editing code on OBS Console.
Procedure
- On the console homepage, click Service List in the upper left corner and choose Storage > Object Storage Service.
- In the bucket list, click the bucket you want to go to the Objects page.
- Click Upload Object to open the Upload Object dialog box.
- Click add files marked by red box in Figure 1 to open the local file browser.
- Select the image that you want to upload and click Open.
- Click Upload to upload the image. The uploaded image is displayed in the object list.
- In the navigation pane, choose Data Processing > Image Processing.
- Click Create to go to the style editing page
- Set Style Name to style002 and choose Code for Edit Mode.
- In the code input box, type the following command for resizing.
Specify a rectangle whose width (indicated by w) and height (indicated by h) are both 100. Lock the aspect ratio, and obtain the smallest image in the extended area of the 100 x 100 rectangle.
image/resize,m_mfit,h_100,w_100
The style effect will be displayed on the right in real time. Figure 2 shows the final style effect.
- Click OK to save the style. The new style style002 will be displayed in the style list.
- In the navigation pane, choose Objects. Click mountain.jpg in the object list to go to the file details page.
- Click the Preview Image tab to preview the effect of the image with style style002 applied. For details, see Figure 3.
- In the image style card, click Copy Link. When Copied successfully. is prompted, you will have the address for accessing the image with the style applied.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot