From 310a4092910557419f6c0dbae6ca61019a300c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=9D=99=E8=8C=B9?= Date: Tue, 29 Aug 2023 02:51:34 +0000 Subject: [PATCH] update zh-cn/application-dev/media/image-tool.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱静茹 --- zh-cn/application-dev/media/image-tool.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/media/image-tool.md b/zh-cn/application-dev/media/image-tool.md index 2d7f8c3220..7fc7947bb0 100644 --- a/zh-cn/application-dev/media/image-tool.md +++ b/zh-cn/application-dev/media/image-tool.md @@ -19,15 +19,15 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe import image from '@ohos.multimedia.image'; // 获取沙箱路径创建ImageSource - const fd = ...; // 获取需要被处理的图片的fd - const imageSource = image.createImageSource(fd); + const fd : number = ...; // 获取需要被处理的图片的fd + const imageSource : ImageSource = image.createImageSource(fd); ``` 2. 读取、编辑EXIF信息。 ```ts // 读取EXIF信息,BitsPerSample为每个像素比特数 - imageSource.getImageProperty('BitsPerSample', (error, data) => { + imageSource.getImageProperty('BitsPerSample', (error : void, data : BitsPerSample) => { if (error) { console.error('Failed to get the value of the specified attribute key of the image.And the error is: ' + error); } else { @@ -37,7 +37,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe // 编辑EXIF信息 imageSource.modifyImageProperty('ImageWidth', '120').then(() => { - const width = imageSource.getImageProperty("ImageWidth"); + const width : number = imageSource.getImageProperty("ImageWidth"); console.info('The new imageWidth is ' + width); }) ``` -- GitLab