android-camera-intent

how to set camera Image orientation?

浪尽此生 提交于 2019-12-17 06:49:09
问题 In my application I have added feature of image uploading,It works fine with all the Images except camera image,whenever I browse camera image from gallery and portrait image rotate in 90 degree..following is my snippet code..can anyone help me?I followed so many tutorials but all of them work well in kikat..but when same tutorial does not work with ics,jellybean etc.. public class MainActivity extends Activity { private Button browse; private String selectedImagePath=""; private ImageView

Camera orientation issue in Android

孤人 提交于 2019-12-17 02:54:13
问题 I am building an application that uses camera to take pictures. Here is my source code to do this: File file = new File(Environment.getExternalStorageDirectory(), imageFileName); imageFilePath = file.getPath(); Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); //Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file)); startActivityForResult(intent, ACTIVITY_NATIVE_CAMERA_AQUIRE); On onActivityResult() method, I

Android startCamera gives me null Intent and … does it destroy my global variable?

血红的双手。 提交于 2019-12-17 02:33:14
问题 I have the next problem: when I try to start my camera, I can take the picture, even save it on my sdcard, but when I'm going to get the path for showing it on my device I get errors. My global variables are 2 (I used 1 but 2 are better for making sure it's a strange error): private File photofile; private Uri mMakePhotoUri; and this is my start-camera function: @SuppressLint("SimpleDateFormat") public void farefoto(int num){ // For naming the picture SimpleDateFormat sdf = new

Android: How to capture image without showing preview

人盡茶涼 提交于 2019-12-14 03:48:25
问题 I am using the following code to capture the image in Android Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, 100); After capturing an image, its showing a preview and asking whether to save or discard the image. Is there anyway where i can avoid this preview? The Camera app in Android dosent shows the preview. So there should be a way i guess. Thanks in advance. 回答1: The camera app doesn't give other apps the option to

Receiving low quality image from camera intent [duplicate]

拟墨画扇 提交于 2019-12-13 20:27:20
问题 This question already has answers here : Low picture/image quality when capture from camera (2 answers) Closed 4 months ago . I am trying to upload an image to firebase using the camera. But, the quality of image i get is too low (not readable). I have written the following code ( with no compilation error). But, can't understand why it's not able to produce a readable image. I have tried varying the quality parameter of bitmap.compress but the image quality remains the same. But the same

Rotate image taken from camera or gallery

爷,独闯天下 提交于 2019-12-13 11:04:54
问题 I am capturing image from camera and selecting image from gallery. In samsung devices the images gets rotate after captured. I want to rotate image to straight if they are rotated. I tried to do it but its not working. I am getting EXIF orientation as 0 always though the image is rotated. private void onCaptureImageResult(Intent data) { try { Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); Uri tempUri = getImageUri(getApplicationContext(), thumbnail); // CALL THIS METHOD TO GET THE

Share images from gallery in Android

前提是你 提交于 2019-12-13 00:14:20
问题 i have written a program which has two buttons , one is for gallery which when clicked displays my images from gallery and another button which starts my camera which displays the captured images. The images are getting displayed properly , but I am not able to understand how to share the displayed images to other apps , please need some help. Below here is my code for sharing : I have put question mark because i need to know what i should pass inside my Uri so that i can get the path of my

Camera.Parameters device specific crash (Samsung S3 Mini)

不想你离开。 提交于 2019-12-12 14:04:23
问题 The following code is working on a Galaxy Nexus, Samsung S3 and HTC One X but it crashes on a Samsung S3 Mini @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { Log.d(TAG, "entering surfaceChanged"); Camera.Parameters parameters = camera.getParameters(); List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes(); // set barcode scene mode if (parameters.getSupportedSceneModes() != null && parameters.getSupportedSceneModes().contains

Take photos from front-facing and rear cameras on android 2.2

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 10:19:18
问题 I'm designing an app (on version 2.2) that use the camera to capture photos. I read from http://developer.android.com/sdk/android-2.3.html that version 2.3 and above have multiple cameras support. But i'm still a bit confused because when the camera is launched, it normally have a button that the user can click to switch between front-facing and rear cameras, right? or 2.2 doesn't have this switch? I want the user to be able to use both front and rear cameras. Is it possible on version 2.2 or

android android.provider.MediaStore.ACTION_VIDEO_CAPTURE return null onActivityResult with nexus 7

风格不统一 提交于 2019-12-12 07:13:53
问题 I am using intent for record video. so i use following code on recordVideo button's click Videofilepath = ""; Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent,REQUEST_VIDEO_CAPTURED); and in onActivityResult protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { switch (requestCode) { case IMAGE_PICK: this.imageFromGallery(resultCode, data); break; case IMAGE_CAPTURE: