camera.listImages
列出相机中的所有图片。此命令已在 API 级别 2 中弃用。
请改用 camera.listFiles
。
如果摄像头不支持所请求的参数,则必须返回
硬件可用的最大功能。例如,在极少数情况下
请求:{entryCount: 500, maxSize: 2000}
。系统不会抛出错误
应基于相机支持的最大功能,
例如 {entryCount: 100, maxSize: 200}
。请为所有其他
案件;例如,当请求为 {entryCount: 500, maxSize: -500}
时,
应抛出错误 invalidParameterValue
,因为 maxSize
为负数。
参数
- entryCount::要返回的条目数。
- maxSize:缩略图的大小上限;max(thumbnail_width, thumbnail_height)。
仅当
includeThumb
为 true(如下所示)时才需要。
- continuationToken::(可选)字符串类型的不透明接续令牌,由上一个
listImages
调用返回,用于检索后续图片。对于第一次 listImages
调用,省略此参数。注意:相机负责生成令牌的算法。
- includeThumb::(可选)默认值为
true
。使用 false
可从结果中省略缩略图。
结果
- entries:图片属性的列表。每个条目应包含以下字段
但纬度和经度是可选项:
<ph type="x-smartling-placeholder">
</ph>
name
:名称
uri
:URI
size
:大小(以字节为单位)
dateTimeZone
:图片的日期、时间和时区,格式为:
YYYY:MM:DD HH:MM:SS+(-)HH:MM
。时间采用 24 小时制。日期
和时间之间用一个空白字符分隔
字符。时区与世界协调时间 (UTC) 相差。
lat
:(可选)图片拍摄位置的纬度。
lng
:(可选)图片拍摄位置的经度。
width
:图片宽度
height
:图片高度
thumbnail
:缩略图的 Base64 编码字符串(使用
includeThumb == true
)。
- totalEntries:存储空间中的条目总数。
- continuationToken::(可选)仅在结果不完整时设置
(不完整表示任何不包含最后一张图片的商家信息。)提取剩余流量
条目,客户端应使用令牌再次调用
listImages
命令。
错误
- missing 参数:未指定任何必需参数;
例如,未指定
entryCount
。
- invalidParameterName:输入参数名称为
无法识别。
- invalidParameterValue::输入参数名称为
但其值无效;例如
continuationToken
不存在、超出范围,其数据
类型不正确、includeThumb
的数据类型不正确,或
当includeThumb
为以下值时,maxSize
的数据类型不正确
true。
命令 I/O |
命令输入 |
{ "parameters": { "entryCount": 50, "maxSize": 100, "includeThumb": true } } |
命令输出 |
{ "results": { "entries": [ { "name": "abc", "uri": "image URI", "size": image size in bytes, "dateTimeZone": "2014:12:27 08:00:00+08:00" "lat": 50.5324 "lng": -120.2332 "width": 2000 "height": 1000 "thumbnail": "ENCODEDSTRING" } ... { ... } ], "totalEntries": 250, "continuationToken": "50" } } |
命令输出(错误) |
{ "error": { "code": "invalidParameterValue", "message": "Parameter continuationToken is out of range." } } |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["`listImages` is deprecated and should be replaced with `camera.listFiles`."],["The camera should return its maximum capability if the requested parameters exceed its limits."],["Results include a list of image properties such as name, URI, size, date/time, location, dimensions, and an optional thumbnail."],["Errors are thrown for missing or invalid parameters, including out-of-range or incorrect data types."],["Use the `continuationToken` for retrieving large lists of images in multiple calls."]]],["The `listImages` command retrieves a list of image properties from the camera, sorted by capture time (newest first). Key actions include specifying parameters like `entryCount`, `maxSize`, and `includeThumb` to customize the result. An optional `continuationToken` fetches subsequent image batches. Results include image details like name, URI, size, date/time, dimensions, and an optional thumbnail. Cameras must adapt to valid parameter requests within hardware capabilities and return errors for invalid parameter values.\n"]]