# previewImage

Calling previewImage(Object object) previews a group of images.

## Support

This API supports calls from gadget and web app, with the corresponding client version support shown below.

App capability | Android | iOS | PC | Harmony | Preview
---|---|---|---|---|---
Gadget | **✓** | **✓** | **✓** | V7.35.0+ | Preview
Web app | V3.44.0+ | V3.44.0+ | V3.47.0+ | V7.35.0+ | Preview

## Input

This API inherits the [Standard object input](https://open.feishu.cn/document/uYjL24iN/ukzNy4SO3IjL5cjM) and has the following extended properties.

Name | Data type | Required | Default value | Description
---|---|---|---|---
urls | string[] | Yes | \- | Image address list. Instructions for use:<br>- Supports local and network urls.<br>- Supports setting one or more pictures. Example values: ["https://example.com/05b68b58.png","https://example.com/p1QpEy0jkK.png"]<br>- The image formats supported by each terminal are different. For details, please refer to:<br>- PC: png, jpg, jpeg, gif, bmp, webp<br>- iOS: png, jpg, jpeg, gif<br>- Android: png, jpg, jpeg, gif, webp
header | object | No | \- | Request header (Header), effective for the incoming network URL. Example value: {"csrf-token": "1234"}<br>**Notice**：**Note**:<br>- PC: Feishu [V3.8.0](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and above versions support setting this field.<br>- Android/iOS: Feishu [V3.3.0](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and above versions support setting this field.
current | string | No | Content of urls[0] | The URL of the image displayed by default. Example value: https://example.com/05b68b58.png
shouldShowSaveOption | boolean | No | true | Whether to display the picture storage function. Explanation of differences in display modes of each terminal:<br>- PC: Whether to display **Download**.<br>- Android/iOS: Whether to display the **Save Image** option after long pressing on the preview page.<br>**Notice**：**Note**: <br>- Android,iOS,PC: Feishu [V6.7.0](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and above versions support setting this field.<br>- Harmony: Feishu [V7.47.0](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and above versions support setting this field.

## Output

This API inherits [Standard object output](https://open.feishu.cn/document/uYjL24iN/ukzNy4SO3IjL5cjM#8c92acb8), without extension property.

##  Sample code

Example call:

```js
tt.previewImage({
    urls: [
        "https://sf3-scmcdn2-cn.feishucdn.com/ee/lark/open/web/static/app-banner.05b68b58.png",
        "https://sf3-cn.feishucdn.com/obj/open-platform-opendoc/33e4ae2ff215314046c51ee1d3008d89_p1QpEy0jkK.png"
    ],
    current: "https://sf3-cn.feishucdn.com/obj/open-platform-opendoc/33e4ae2ff215314046c51ee1d3008d89_p1QpEy0jkK.png",
    success(res) {
      console.log(JSON.stringify(res));
    },
    fail(res) {
      console.log(`previewImage fail: ${JSON.stringify(res)}`);
    }
});
```

Sample return object for success:

```json
{
    "errMsg": "previewImage:ok"
}
```

## Error code

The `fail` return object may contain the errno attribute, indicating the error code. For detailed descriptions of errno error codes and a list of common error codes, see [Errno](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/errno).