Code Mode

This section shows an example on how to create a resizing style in Code mode on OBS Console.

Procedure

  1. Log in to the management console.
  2. On the homepage of the management console, choose All Services > Storage > Object Storage Service.
  3. In the bucket list, click the target bucket to go to the Overview page.
  4. In the navigation tree on the left, click Object.
  5. Click Upload. The Upload Object page is then displayed.
  6. Click the red-line-marked button to select files, as shown in Figure 1.

    Figure 1 Upload File

  7. Select the image that you want to upload and click Open.
  8. Click OK.
  9. Click the bucket name. Select Image Processing, as shown in Figure 2.

    Figure 2 Image Processing

  10. Click Create Style to go to the style editing page.
  11. Input the style name style002. On the editing page, select Code.
  12. In the code input box, input the following command and parameters for resizing.

    Specify a rectangle, whose w and h equal 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 3 shows the final style effects.

    Figure 3 Style style002

  13. After you finish editing the image style, click OK to save the style. The new style style002 will be displayed in the style list, as shown in Figure 4.

    Figure 4 Style created successfully

  14. In the navigation tree on the left, select Object. Click flower.jpg in the object list to go to the file details page.
  15. By clicking the Preview Image tab, you can preview the effect of the current style, as shown in Figure 5.

    Figure 5 Preview Image

  16. Click Copy Link. After prompted with Copied successfully, you can obtain the access address of the image file.
Registration