Esta página aún no está disponible en su idioma local. Estamos trabajando arduamente para agregar más versiones de idiomas. Gracias por tu apoyo.

Compressing Images

Updated on 2023-09-11 GMT+08:00

When an image is uploaded or updated to bucket your-bucket-input, an event is generated to trigger the function. The function compresses the image and stores the compressed one into bucket your-bucket-output.

Uploading an Image to Generate an Event

Log in to the OBS console, go to the object page of the your-bucket-input bucket, and upload the image.jpg image, as shown in Figure 1.

Figure 1 Uploading an image
NOTE:

The size of the original image.jpg file exceeds 28 KB.

Triggering the Function

After the image is uploaded to bucket your-bucket-input, OBS generates an event to trigger the image compressing function. The function compresses the image and stores the compressed one into bucket your-bucket-output. You can view running logs of the function on the Logs tab page.

Go to the Objects page of the your-bucket-output bucket and view the size of the compressed image.

Figure 2 Compressing the image
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback