camera.getMetadata
Trả về siêu dữ liệu của tệp dựa trên URI. Tiêu đề hình ảnh
liệt kê các trường Exif và XMP. Lệnh này không còn được dùng trong API cấp 2.
Tham số
- fileUri: URI của tệp đích. Các nhà sản xuất quyết định xem
để sử dụng URI tuyệt đối hoặc tương đối. Ứng dụng có thể coi đây là giá trị nhận dạng không rõ ràng.
Kết quả
- siêu dữ liệu: Exif (bao gồm thông tin GPS), Ảnh toàn cảnh 360 độ XMP trong
Định dạng JSON. Không bao gồm hình ảnh hoặc hình thu nhỏ.
Lỗi
- ThiếuTham số:
fileUri
không được chỉ định.
- không hợp lệTham số: Tên tham số đầu vào không nhận dạng được.
- invalidParameterValue: Tham số đầu vào được nhận dạng, nhưng tham số
giá trị không hợp lệ; ví dụ:
fileUri
không tồn tại hoặc dữ liệu của nó
không chính xác.
Lệnh I/O |
Nhập lệnh |
{ "parameters": { "fileUri": "file URI" } } |
Kết quả lệnh |
{ "results": { "exif": { ... "ImageWidth": 2000, "ImageLength": 1000, ... }, "xmp": { "ProjectionType": "equirectangular", "UsePanoramaViewer": true, ... } } } |
Ra lệnh (Lỗi) |
{ "error": { "code": "invalidParameterValue", "message": "Parameter fileUri doesn't exist." } } |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-21 UTC."],[[["Returns file metadata such as Exif and XMP data for a given file URI."],["This command is deprecated and was previously used in API level 2."],["Important parameters include the `fileUri`, which specifies the location of the target file."],["Potential errors encompass missing or invalid parameters, including an invalid or non-existent `fileUri`."],["The command output provides Exif and Photo Sphere XMP data in JSON format if successful."]]],["This command retrieves a file's metadata using its URI. It's deprecated in API level 2. Input requires a `fileUri`. The output provides Exif data (including GPS) and Photo Sphere XMP in JSON format, excluding the image itself. Possible errors include a missing or invalid `fileUri`, or an unrecognized parameter name. Example input shows providing a file URI, with successful output including `exif` and `xmp` fields, and error output shown when a file URI does not exist.\n"]]