camera.getImage
指定された URI で、フルサイズまたはスケーリングされた画像を返します。入力パラメータの例
解決します。Content-Type: image/jpeg
が返されるのはこのコマンドのみです。
他のすべてのコマンドは Content-Type: application/json;charset=utf-8
を返します。
このコマンドは API レベル 2 で非推奨になりました。
パラメータ
- fileUri: ターゲット ファイルの URI。使用するかどうかはメーカーが決定します
指定することもできます。クライアントはこれを不透明な識別子として扱う場合があります。
- maxSize: (省略可)リクエストされる画像の最大サイズ。
max(scaledimage_width, scaledimage_height)。
maxSize
が省略されるかそれより大きい場合
フルサイズの画像よりも小さい場合は、フルサイズの画像が返されます。
結果
- content: 対応する画像バイナリデータ(スケーリングなど)
メタデータを指定します。
エラー
- missingParameter: 必須の
fileUri
が指定されていません。
- invalidParameterName: 入力パラメータ名を認識できません。
- invalidParameterValue: 入力パラメータ名は認識されますが、その値は
は無効です。たとえば、
fileUri
の値が存在しない場合や、データ型が正しくない場合などです。
または maxSize
のデータ型が正しくありません。
コマンド I/O |
コマンド入力 |
{ "parameters": { "fileUri": "file URI", "maxSize": 400 } } |
コマンド出力 |
Image binary data |
コマンド出力(エラー) |
{ "error": { "code": "invalidParameterValue", "message": "Parameter fileUri doesn't exist." } } |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-21 UTC。
[null,null,["最終更新日 2024-08-21 UTC。"],[[["Returns a full-size or scaled image based on its URI, with optional resizing using the `maxSize` parameter."],["This command is deprecated and was replaced in API level 2, primarily used for retrieving image data in JPEG format."],["Input requires a `fileUri` parameter, while `maxSize` is optional for scaling the output image."],["Output provides the image as binary data, including relevant metadata, or an error message in JSON format."],["Potential errors involve missing or invalid parameters, such as an incorrect `fileUri` or `maxSize` value."]]],["The command retrieves an image (full-size or scaled) via its URI, with `fileUri` being mandatory and `maxSize` (maximum dimension) being optional. If `maxSize` is omitted or exceeds the image's full size, the full-size image is provided. Output is image binary data, with `Content-Type: image/jpeg`. Errors include missing/invalid parameter or invalid value. It was deprecated in API level 2. Example input involves `fileUri` and `maxSize`. Example error is related to an invalid `fileUri`.\n"]]