Access rules for image processing

Products

Object Storage Service

2022-02-18 08:33:07

Access rules for image processing

The image service is accessed by GET request of standard HTTP and all processing parameters are also in the QueryString of URL.

Request for thumbnail through processing parameters

  1. Users request for image processing interface

(a) Old interface: connect “?img/processing parameters” after the original file address

For example, http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?img/s/200/300

(b) New interface: connect “?x-oss-process=img/processing parameters” after the original file address

For example, http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?x-oss-process=img/s/200/300

  1. Request for original image

(a) File direct download mode

For example, http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg

(b) Image processing parameter mode

For example, http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?x-oss-process=img/o

  1. Image processing actions support sequential queue

Connect image processing instructions as a processing queue in sequence and segment each task name and ancillary parameter with “/”; then background will execute them in sequence.

For example:

Original image address: http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg

Processing mode: scale in turn and crop in the center

Resultant address of relative image processing:

http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?x-oss-process=img/s/200/300/cc/200/260

  1. In the processing queue, sequential execution will affect final results.

  2. Cap of the maximum number of processing actions of a single request <=100; repetitive operation is accumulated.

For example, in http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?x-oss-process=img/s/200/300/cc/200/260

Scale s and center crop cc are recorded as two actions.

  1. Total length of processing parameters cannot exceed 1024 bytes

For example, in http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?x-oss-process=img/s/200/300/cc/200/260

The part of processing parameters includes img/s/200/300/cc/200/260

Request for thumbnail through Style

Image processing can save user's image processing actions and parameters as another name (e.g. Stylename), namely style. After using the style function, a same effect can be archived only with a very short URL to replace the original series of actions.

(a) Old interface

http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?imgalias/stylename

(b) New interface

http://downloads.s3.cn-north-1.jdcloud-oss.com/lena.jpg?x-oss-process=imgalias/stylename

Specification description of image parameter processing

Image processing includes the following keywords imgalias,img,imginfo,imgexif,x-oss-process=imgalias,x-oss-process=img,x-oss-process=imginfo,x-oss-process=imgexif

  • Under circumstances where the parameter image processing parameter is legal, only one of the above keywords can appear

    For example:

    bucketname.s3.cn-north-1.jdcloud-oss.com/key.jpg?imgalias/style&img/s/100/200 (illegal)

    bucketname.s3.cn-north-1.jdcloud-oss.com/bucket/key.jpg?imgalias/style&x-oss-process=imgalias/style2 (illegal)

    bucketname.s3.cn-north-1.jdcloud-oss.com/key.jpg?imgalias/style (legal)

  • imgalias, img, x-oss-process=imgalias, x-oss-process=img parameter must be followed by a specific parameter

    For example:

    bucketname.s3.cn-north-1.jdcloud-oss.com/key.jpg?imgalias/ (illegal)

  • KV of RequestQuery has no specified sequence

    For example:

    bucketname.s3.cn-north-1.jdcloud-oss.com/key.jpg?aaa=bb&imgalias/style (legal)

  • RequestQuery case sensitivity(KV has case sensitivity)

    For example:

    bucketname.s3.cn-north-1.jdcloud-oss.com/key.jpg?imgalias/style (legal)

    bucketname.s3.cn-north-1.jdcloud-oss.com/key.jpg?Imgalias/style (access artwork normally)

Feedback

开始与售前顾问沟通

可直接拨打电话 400-098-8505转1

我们的产品专家为您找到最合适的产品/解决⽅案

在线咨询 5*8⼩时

1v1线上咨询获取售前专业咨询

点击咨询
企微服务助手

专业产品顾问,随时随地沟通