All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

imageInfo

Last updated:2021-09-14 16:17:55

Operation

imageInfo

Description

You can call this operation to query the basic information of an image, including its format, size, width, height, color model, and number of frames. The result is returned in JSON format.

  • Image formats are means of storing images in computers. Image formats include BMP, JPG, TIFF, GIF, PCX, TGA, Exif, FPX, SVG, PSD, CDR, PCD, DXF, UFO, EPS, AI, and RAW.

  • The image size is the size of the storage space used by an image in bytes (B), kilobytes (KB), and megabytes (MB). The size greater than 1,024 B will be converted to the size in KB, and the size greater than 1,024 KB will be converted to the size in MB.

  • The image width and height are expressed in pixels.

  • The color model, also known as color pattern, is an algorithm for representing colors in the digital world. Colors are usually divided into several components to represent colors in a digital way. Different coloring mechanisms differentiate devices that synthesize colors by using color lights such as displays, projectors, and scanners from devices that use pigments such as printers and printing machines. General color models include HSB, RGB, Lab, and CMYK.

  • The number of image frames refers to the number of static images that make up a GIF image.

Permission

To call this operation, you must have the GetObject permission. If the object does not exist, the following errors may be returned:

  • If you have the ListBucket permission on the bucket where the object resides, KS3 returns a 404 error.
  • If you do not have the ListBucket permission on the bucket, KS3 returns a 403 error.

Request

Syntax

    https://BucketName.${Endpoint of the bucket}/object@base@tag=imageInfo  HTTP/1.1
    Host: BucketName.${Endpoint of the bucket}

Request parameters

You do not need to set parameters for this request.

Request header

The request does not require a special header.

Response

Response header

Header Required Description
Content-Type Yes The MIME type, which is fixed to application/json.

Response body

Field Description
Format The format of the image, such as PNG, JPG, GIF, and BMP.
Size The size of the storage space used by the image. Unit: B, KB, and MB.
Width The width of the image. Unit: pixels.
Height The height of the image. Unit: pixels.
colorModel The color model of the image. General color models include HSB, RGB, Lab and CMYK.
frameNumber The number of frames of the image. This field is returned when the image is a GIF image.

Operation-specific errors

HTTP status code Description
400 The request format is incorrect.
404 The specified resource does not exist.
403 The access is denied.
500 An internal server error occurred.

Examples

1. Enter the following request in the address bar of your web browser:
https://ks3.ks3-cn-beijing.ksyuncs.com/image_deal/kssyun.png@base@tag=imageInfo

2. Sample response
{
    "colorModel":"TrueColor",
    "format":"JPEG",
    "height":2448,
    "size":"1.8M",
    "width":3264
}
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback