Applying Image Styles
When a created image style exists in a bucket, use either of the following methods to apply the image style:
- Copying Link: On OBS console, obtain the image URL when previewing the image on the details page. Enter the URL in the address bar of a browser, and you can obtain the processed image. Copying Links shows the procedure in detail.
- Concatenating domain names: Concatenate a domain name by referring to the following rule, enter it in the address bar of a browser, and obtain the processed image.
<Image URL>?x-image-process=style/<Style name>
The image URL can be obtained from the object details page. For details, see Editing Domain Names. The style name is the one defined when the style was created. A style name can contain only uppercase or lowercase letters, digits, periods (.), underscores (_), and hyphens (-) and is 1 to 256 characters long, for example, rotate_0001.
Copying Links
- On the console homepage, click Service List in the upper left corner and choose Storage > Object Storage Service.
- Click the name of the bucket that houses the desired style. The Objects page is displayed.
- Click the name of an existing image or of a newly uploaded image. The details page is displayed.
- Click the Preview Image tab to preview the effect of the current style.
- Click Copy Link. After prompted with Copied successfully, you can obtain the address of the image that uses styles and then access the image in the browser.
Editing Domain Names
- On the OBS object list page, click an image to be processed. The image details page is displayed.
- Choose Object ACL > Public Permissions > Anonymous User and click Edit. In the displayed dialog box, grant the object read permission to anonymous users and click Save.
- Click the icon next to the link to copy the image URL.
- Add ?x-image-process=style/<Style name> behind the copied URL. Enter it in the address bar of a browser, and then you can access the processed image.
Example:
https://bucketname.obs.region.example.com/example.jpg?x-image-process=style/stylename
The preceding image links and styles are examples for reference only. Change accordingly in practice.
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