מצלמה.getImage
מחזירה תמונה בגודל מלא או תמונה בגודל מלא בהינתן ה-URI שלה. הפרמטרים של הקלט כוללים
ורזולוציה. זו הפקודה היחידה שאמורה לחזור, Content-Type: image/jpeg
.
כל שאר הפקודות מחזירות Content-Type: application/json;charset=utf-8
.
הפקודה הזו הוצאה משימוש ברמת API 2.
פרמטרים
- fileUri: ה-URI של קובץ היעד. היצרנים מחליטים אם להשתמש
מזהי URI מוחלטים או יחסיים. לקוחות יכולים להתייחס למזהה הזה בתור מזהה אטום.
- maxSize: (אופציונלי) הגודל המקסימלי של התמונה המבוקשת.
max(scaledimage_width, scaledimage_height) אם לא מציינים את הפרמטר
maxSize
או אם הוא גדול יותר
מאשר התמונה בגודל מלא, תוחזר תמונה בגודל מלא.
תוצאות
- content: נתונים בינאריים של תמונות, כולל נתונים תואמים (לדוגמה, נתונים מותאמים)
מטא-נתונים בכותרת התמונה.
שגיאות
- missingParameter: ה-
fileUri
הנדרש לא צוין.
- INVALIDParameterName: שם פרמטר קלט לא מזוהה.
- invalidParameterValue: השם של פרמטר הקלט מזוהה, אבל הערך שלו
לא חוקית, לדוגמה, הערך
fileUri
לא קיים, סוג הנתונים שלו שגוי,
או מסוג maxSize
, סוג הנתונים שגוי.
Command I/O |
קלט פקודה |
{ "parameters": { "fileUri": "file URI", "maxSize": 400 } } |
פלט הפקודה |
Image binary data |
פלט הפקודה (שגיאה) |
{ "error": { "code": "invalidParameterValue", "message": "Parameter fileUri doesn't exist." } } |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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"]]