Camera.getImage
दिए गए यूआरआई के आधार पर, पूरे साइज़ या स्केल की गई इमेज दिखाता है. इनपुट पैरामीटर में ये शामिल हैं
का रिज़ॉल्यूशन. सिर्फ़ यही निर्देश देना चाहिए, Content-Type: image/jpeg
.
अन्य सभी निर्देश Content-Type: application/json;charset=utf-8
दिखाते हैं.
इस निर्देश को एपीआई लेवल 2 में बंद कर दिया गया था.
पैरामीटर
- fileUri: टारगेट फ़ाइल का यूआरआई. मैन्युफ़ैक्चरर तय करते हैं कि उन्हें
निरपेक्ष या मिलते-जुलते यूआरआई. क्लाइंट इसे ओपेक आइडेंटिफ़ायर मान सकते हैं.
- maxSize: (ज़रूरी नहीं) अनुरोध की गई इमेज का ज़्यादा से ज़्यादा साइज़;
max(Scaledimage_width, landscape_height). अगर
maxSize
को हटा दिया गया है या उससे बड़ा किया गया है
फ़ुल साइज़ की इमेज की तुलना में फ़ुल साइज़ की इमेज दिखती है.
नतीजे
- content: इमेज बाइनरी डेटा, जिसमें इनसे जुड़ी चीज़ें (उदाहरण के लिए, स्केल की गई) भी शामिल हैं
इमेज के हेडर में मेटाडेटा.
गड़बड़ियां
- वैल्यू मौजूद नहीं है: ज़रूरी
fileUri
नहीं दिया गया है.
- अमान्य पैरामीटर का नाम: इनपुट पैरामीटर के नाम की पहचान नहीं की जा सकी.
- invalidParameterValue: इनपुट पैरामीटर के नाम की पहचान हो गई है, लेकिन इसकी वैल्यू
अमान्य है; उदाहरण के लिए,
fileUri
वैल्यू मौजूद नहीं है, उसका डेटा टाइप गलत है,
या maxSize
का डेटा टाइप गलत है.
कमांड 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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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"]]