camera.getImage
তার URI দেওয়া একটি পূর্ণ-আকার বা স্কেল করা চিত্র প্রদান করে। ইনপুট পরামিতি রেজোলিউশন অন্তর্ভুক্ত. এটিই একমাত্র কমান্ড যা ফিরে আসা উচিত, Content-Type: image/jpeg
। অন্যান্য সমস্ত কমান্ড Content-Type: application/json;charset=utf-8
। এপিআই লেভেল 2-এ এই কমান্ডটি বাতিল করা হয়েছে।
পরামিতি
- fileUri: টার্গেট ফাইলের URI। পরম বা আপেক্ষিক URI ব্যবহার করবেন কিনা তা নির্মাতারা সিদ্ধান্ত নেয়। ক্লায়েন্টরা এটিকে একটি অস্বচ্ছ শনাক্তকারী হিসাবে বিবেচনা করতে পারে।
- maxSize: (ঐচ্ছিক) অনুরোধ করা ছবির সর্বোচ্চ আকার; সর্বোচ্চ (স্কেলডিমেজ_প্রস্থ, স্কেলডিমেজ_উচ্চতা)। যদি
maxSize
বাদ দেওয়া হয় বা পূর্ণ-আকারের চিত্রের চেয়ে বড় হয়, তাহলে পূর্ণ-আকারের চিত্রটি ফেরত দেওয়া হয়।
ফলাফল
- বিষয়বস্তু: ইমেজ হেডারে সংশ্লিষ্ট (উদাহরণস্বরূপ, স্কেল করা) মেটাডেটা সহ চিত্র বাইনারি ডেটা।
ত্রুটি
- 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."
}
} |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2024-11-09 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2024-11-09 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"]]