Fixed
Status Update
Comments
ds...@gmail.com <ds...@gmail.com> #2
This issue will be addressed in the Cupcake release.
jb...@google.com <jb...@google.com>
bo...@gmail.com <bo...@gmail.com> #3
Well, now on 1.5, the documentation has been updated: "If the EXTRA_OUTPUT is not
present, then a small sized image is returned as a Bitmap object in the extra field.
If the EXTRA_OUTPUT is present, then the full-sized image will be written to
the Uri value of EXTRA_OUTPUT."
But using the following piece of code:
private void takePic2() {
Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(new File(FILE_PATH)));
startActivityForResult(imageCaptureIntent, 1);
}
The resulting image is 512x384 (on the ADP1).
Whereas when you use the bundled Camera app, the pictures are taken at a 2048x1536
resolution.
The code should be fixed or the documentation updated to reflect that the returned
image is actually not 'full-sized'.
present, then a small sized image is returned as a Bitmap object in the extra field.
If the EXTRA_OUTPUT is present, then the full-sized image will be written to
the Uri value of EXTRA_OUTPUT."
But using the following piece of code:
private void takePic2() {
Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(new File(FILE_PATH)));
startActivityForResult(imageCaptureIntent, 1);
}
The resulting image is 512x384 (on the ADP1).
Whereas when you use the bundled Camera app, the pictures are taken at a 2048x1536
resolution.
The code should be fixed or the documentation updated to reflect that the returned
image is actually not 'full-sized'.
bo...@gmail.com <bo...@gmail.com> #5
Read again, Yaroshw1
The doc says:
1/ "If the EXTRA_OUTPUT is not present, then a small sized image is returned"
2/ "If the EXTRA_OUTPUT is present, then the *full-sized* image will be written"
Alas 2/ is not true, it produces a 512x384 image - that is not "full sized".
Instead of just fixing the doc, though, it would be very useful to make this call
return a full-sized picture (or maybe adding an Extra to indicate we want full-size,
to not break existing code).
MediaStore.ACTION_IMAGE_CAPTURE is almost perfect, except the returned picture is not
full-sized, hence developers need to implement their own little 'Camera App'-like
activity to be able to take a picture inside their app.
The doc says:
1/ "If the EXTRA_OUTPUT is not present, then a small sized image is returned"
2/ "If the EXTRA_OUTPUT is present, then the *full-sized* image will be written"
Alas 2/ is not true, it produces a 512x384 image - that is not "full sized".
Instead of just fixing the doc, though, it would be very useful to make this call
return a full-sized picture (or maybe adding an Extra to indicate we want full-size,
to not break existing code).
MediaStore.ACTION_IMAGE_CAPTURE is almost perfect, except the returned picture is not
full-sized, hence developers need to implement their own little 'Camera App'-like
activity to be able to take a picture inside their app.
pe...@gmail.com <pe...@gmail.com> #6
I can confirm what BoDlulu is seeing.
Before setting EXTRA_OUTPUT the image size was 192x256. After setting EXTRA_OUTPUT
the image size is 512x384.
This is on 1.5 (Cupcake) on an HTC Magic where the camera sensor's full output size
is 2048x1536 (3.2 Megapixels).
Thanks,
Pete Doyle
Before setting EXTRA_OUTPUT the image size was 192x256. After setting EXTRA_OUTPUT
the image size is 512x384.
This is on 1.5 (Cupcake) on an HTC Magic where the camera sensor's full output size
is 2048x1536 (3.2 Megapixels).
Thanks,
Pete Doyle
mi...@gmail.com <mi...@gmail.com> #7
Hi, does anyone know how can i get the picture (the big size one) without using a
file? something like "Bitmap bmp = (Bitmap) extras.get("data");" when i get the small
size picture
file? something like "Bitmap bmp = (Bitmap) extras.get("data");" when i get the small
size picture
ya...@gmail.com <ya...@gmail.com> #8
you can't get the big sized picture without using a file. the best you can do is save
a temp file, insert it into the content provider and delete that tmp file. the uri
you get back can then be used in your app.
// fire off the intent
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new
File(Constants.TMPFILE_PATH)));
startActivityForResult(i, mRequestCode);
// on activity return
File f = new File(Constants.TMPFILE_PATH);
try {
Uri u =
Uri.parse(android.provider.MediaStore.Images.Media.insertImage(getContentResolver(),
fi.getAbsolutePath(), null, null));
f.delete();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
a temp file, insert it into the content provider and delete that tmp file. the uri
you get back can then be used in your app.
// fire off the intent
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new
File(Constants.TMPFILE_PATH)));
startActivityForResult(i, mRequestCode);
// on activity return
File f = new File(Constants.TMPFILE_PATH);
try {
Uri u =
Uri.parse(android.provider.MediaStore.Images.Media.insertImage(getContentResolver(),
fi.getAbsolutePath(), null, null));
f.delete();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mi...@gmail.com <mi...@gmail.com> #9
ok. Thank you
ju...@gmail.com <ju...@gmail.com> #10
The problem is that a big sized / full resolution picture can't be retrieved, not
even using a file.
The bitmap in the extras is small sized, but the picture stored in a file (if the
output extra is specified) also has smaller dimensions than it should have. To be
more precise, it will reduce by 4 both the width and the length of the full
resolution picture.
I was just looking through the source code of the camera and I believe the problem is
in the storeImage method inside the ImageCapture private class.
public void storeImage(byte[] data, android.hardware.Camera camera, Location
loc) {
boolean captureOnly = mIsImageCaptureIntent;
if (!captureOnly) {
storeImage(data, loc);
sendBroadcast(new Intent("com.android.camera.NEW_PICTURE",
mLastContentUri));
setLastPictureThumb(data, mCaptureObject.getLastCaptureUri());
dismissFreezeFrame();
} else {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
....
When the file is written (in the destination specified using the
MediaStore.EXTRA_OUTPUT extra), both dimensions will be reduced by 4. Which is
consistent with the test I've done. "options.inSampleSize = 4;" is what causes this.
It would be good if this behavior was changed to write a file with the full
resolution picture, of if more extras were put in place to be able to set a target
resolution along with the intent.
even using a file.
The bitmap in the extras is small sized, but the picture stored in a file (if the
output extra is specified) also has smaller dimensions than it should have. To be
more precise, it will reduce by 4 both the width and the length of the full
resolution picture.
I was just looking through the source code of the camera and I believe the problem is
in the storeImage method inside the ImageCapture private class.
public void storeImage(byte[] data, android.hardware.Camera camera, Location
loc) {
boolean captureOnly = mIsImageCaptureIntent;
if (!captureOnly) {
storeImage(data, loc);
sendBroadcast(new Intent("com.android.camera.NEW_PICTURE",
mLastContentUri));
setLastPictureThumb(data, mCaptureObject.getLastCaptureUri());
dismissFreezeFrame();
} else {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
....
When the file is written (in the destination specified using the
MediaStore.EXTRA_OUTPUT extra), both dimensions will be reduced by 4. Which is
consistent with the test I've done. "options.inSampleSize = 4;" is what causes this.
It would be good if this behavior was changed to write a file with the full
resolution picture, of if more extras were put in place to be able to set a target
resolution along with the intent.
ad...@gmail.com <ad...@gmail.com> #11
[Comment deleted]
ad...@gmail.com <ad...@gmail.com> #12
I have been going through code for Camera app and I dont think that
"options.inSampleSize = 4" is cause of the problem. Because if you have provided
EXTRA_OUTPUT then "if" part of this condition statement should be executed and not
the "else" part. As you see image is only stored in the "if" part of the if-else
statement where as in "else" part a bitmap is created and nothing gets saved to file
system
"options.inSampleSize = 4" is cause of the problem. Because if you have provided
EXTRA_OUTPUT then "if" part of this condition statement should be executed and not
the "else" part. As you see image is only stored in the "if" part of the if-else
statement where as in "else" part a bitmap is created and nothing gets saved to file
system
re...@gmail.com <re...@gmail.com> #13
No, I think julius.caro is right:
doAttach() is called after a picture is taken, which fetches the bitmap using the
mImageCapture.getLastBitmap() method.
This method only returns mCaptureOnlyBitmap, which is set in the storeImage() method.
It's in this method the scaling occurs, just like julius.caro says: inSampleSize is
set to 4, which according to the documentation scales the image.
Why is this done? And when will it be fixed so we can use this to easily grab a
picture from the camera? I'm reluctant to add camera functionality to my app because
of possible problems with inconsistency on future models (for example the flash
problems on the Galaxy).
doAttach() is called after a picture is taken, which fetches the bitmap using the
mImageCapture.getLastBitmap() method.
This method only returns mCaptureOnlyBitmap, which is set in the storeImage() method.
It's in this method the scaling occurs, just like julius.caro says: inSampleSize is
set to 4, which according to the documentation scales the image.
Why is this done? And when will it be fixed so we can use this to easily grab a
picture from the camera? I'm reluctant to add camera functionality to my app because
of possible problems with inconsistency on future models (for example the flash
problems on the Galaxy).
wr...@gmail.com <wr...@gmail.com> #14
I'm experiencing the same problem and I can't even get yanokwa's solution to work.
It seems like the activity is ignoring the EXTRA_OUTPUT parameter all together.
It seems like the activity is ignoring the EXTRA_OUTPUT parameter all together.
ch...@gmail.com <ch...@gmail.com> #15
On an HTC Hero, this EXTRA_OUTPUT doesn't even work. It doesn't put your picture in
the file you specify, but it hands it to you thru a Mediastore uri. Apparently, the
only way to get a full size picture is to do all camera handling in your app instead
of using the IMAGE_CAPTURE intent.
the file you specify, but it hands it to you thru a Mediastore uri. Apparently, the
only way to get a full size picture is to do all camera handling in your app instead
of using the IMAGE_CAPTURE intent.
ne...@gmail.com <ne...@gmail.com> #16
Ignoring the EXTRA_OUTPUT option for now, and receiving a small bitmap in the Intent
that is returned by using:
Bitmap bmp = (Bitmap) extras.get("data");
How can I then get hold of the contentUri of the stored image? I don't want the
actual image, just the path to its stored location.
that is returned by using:
Bitmap bmp = (Bitmap) extras.get("data");
How can I then get hold of the contentUri of the stored image? I don't want the
actual image, just the path to its stored location.
te...@gmail.com <te...@gmail.com> #17
Does anyone know if this issue has been address in 1.6?
I'm a little surprised that this problem doesn't seem to be getting more attention.
It very much limits the ability of developers to make use of cameras on devices. My
app currently uses a custom Activity (the "build your own camera app" approach) to
get a full resolution image, but this is a very non-ideal solution because the
camera code is so unpredictable on different hardware. It works fine in the
emulator and on the HTC Magic, it has strange artifacts on Samsung's Galaxy
(mirrored preview, etc.), and it just crashes on the HTC Dream. A simple way to get
the full image back from the standard camera app would be life-saving and avoid
differing hardware woes for developers. Please fix this!
-Todd
I'm a little surprised that this problem doesn't seem to be getting more attention.
It very much limits the ability of developers to make use of cameras on devices. My
app currently uses a custom Activity (the "build your own camera app" approach) to
get a full resolution image, but this is a very non-ideal solution because the
camera code is so unpredictable on different hardware. It works fine in the
emulator and on the HTC Magic, it has strange artifacts on Samsung's Galaxy
(mirrored preview, etc.), and it just crashes on the HTC Dream. A simple way to get
the full image back from the standard camera app would be life-saving and avoid
differing hardware woes for developers. Please fix this!
-Todd
ad...@gmail.com <ad...@gmail.com> #18
I think Google have missed a trick on this one. They have defined standard intents
for media capture, but not specified standard responses (ie. the "data" parameter in
the onActivityResult Activity callback method). Other Android vendors (e.g. HTC
Hero) have created their own Camera applications that handle the standard
IMAGE_CAPTURE intent, but return different data & have different ways to save/return
the image information. All I want is to be able to fire a IMAGE_CAPTURE intent from
my own app, and get back a Uri reference to the captured image. Simple. I have no
requirement to further manipulate the image .. I just need the Uri to store in my
app's database for future reference.
for media capture, but not specified standard responses (ie. the "data" parameter in
the onActivityResult Activity callback method). Other Android vendors (e.g. HTC
Hero) have created their own Camera applications that handle the standard
IMAGE_CAPTURE intent, but return different data & have different ways to save/return
the image information. All I want is to be able to fire a IMAGE_CAPTURE intent from
my own app, and get back a Uri reference to the captured image. Simple. I have no
requirement to further manipulate the image .. I just need the Uri to store in my
app's database for future reference.
on...@gmail.com <on...@gmail.com> #19
Hello,
this not working intent is really annoying. We implemented our own camera activity
which works in 1.5 but it does not work in 1.6 because of auto-focus.
Please fix this. Why we have to write our own camera activity. How many of them are
around?
Thanks
Ondra
this not working intent is really annoying. We implemented our own camera activity
which works in 1.5 but it does not work in 1.6 because of auto-focus.
Please fix this. Why we have to write our own camera activity. How many of them are
around?
Thanks
Ondra
ch...@gmail.com <ch...@gmail.com> #20
Camera shouldn't be a problem in 1.6. I have a Camera implementation because the
default intent doesn't give you a full size picture. The implementation works fine in
1.6.
default intent doesn't give you a full size picture. The implementation works fine in
1.6.
ha...@gmail.com <ha...@gmail.com> #21
Hi guys,
Does anyone have the image capture application for 1.5? if so can you please attach
it here?
thanks
Does anyone have the image capture application for 1.5? if so can you please attach
it here?
thanks
ha...@gmail.com <ha...@gmail.com> #22
Hi guys,
Does anyone have the image capture application for 1.5? if so can you please attach
it here?
thanks
Does anyone have the image capture application for 1.5? if so can you please attach
it here?
thanks
mi...@gmail.com <mi...@gmail.com> #23
Hi, this is my camera activity and it works in 1.6. The problem is that I don't get
EXIF data, so I have to write the data.
public class CameraActivity extends Activity implements SurfaceHolder.Callback,
Camera.AutoFocusCallback, Camera.PictureCallback
{
Camera mCamera;
boolean mPreviewRunning = false;
ImageButton takePictureButton;
View waitView;
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
setContentView(R.layout.camera);
mSurfaceView = (SurfaceView) findViewById(R.id.surface);
waitView = findViewById(R.id.wait_icon);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
public void surfaceCreated(SurfaceHolder holder)
{
mCamera = Camera.open();
}
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h)
{
if (mPreviewRunning)
{
mCamera.stopPreview();
}
Camera.Parameters p = mCamera.getParameters();
p.setPreviewSize(w, h);
p.setPictureFormat(PixelFormat.JPEG);
mCamera.setParameters(p);
try
{
mCamera.setPreviewDisplay(holder);
} catch (IOException e)
{
e.printStackTrace();
}
mCamera.startPreview();
mPreviewRunning = true;
}
public void surfaceDestroyed(SurfaceHolder holder)
{
mCamera.stopPreview();
mPreviewRunning = false;
mCamera.release();
}
private SurfaceView mSurfaceView;
private SurfaceHolder mSurfaceHolder;
public void onAutoFocus(boolean success, Camera camera)
{
camera.takePicture(null, null, this);
}
private static String file_name = "temp_img";
public void onPictureTaken(byte[] data, Camera camera)
{
// Matrix m = new Matrix();
// m.postRotate(90);
// Bitmap nb = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(),
// m, true);
try
{
FileOutputStream fos = openFileOutput(file_name, MODE_PRIVATE);
fos.write(data);
fos.close();
} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
Intent i = new Intent(this, PhotoEditActivity.class);
i.putExtra("data", file_name);
this.finish();
startActivity(i);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_CAMERA)
{
mCamera.autoFocus(this);
return true;
}
return super.onKeyDown(keyCode, event);
}
}
EXIF data, so I have to write the data.
public class CameraActivity extends Activity implements SurfaceHolder.Callback,
Camera.AutoFocusCallback, Camera.PictureCallback
{
Camera mCamera;
boolean mPreviewRunning = false;
ImageButton takePictureButton;
View waitView;
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
setContentView(R.layout.camera);
mSurfaceView = (SurfaceView) findViewById(R.id.surface);
waitView = findViewById(R.id.wait_icon);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
public void surfaceCreated(SurfaceHolder holder)
{
mCamera = Camera.open();
}
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h)
{
if (mPreviewRunning)
{
mCamera.stopPreview();
}
Camera.Parameters p = mCamera.getParameters();
p.setPreviewSize(w, h);
p.setPictureFormat(PixelFormat.JPEG);
mCamera.setParameters(p);
try
{
mCamera.setPreviewDisplay(holder);
} catch (IOException e)
{
e.printStackTrace();
}
mCamera.startPreview();
mPreviewRunning = true;
}
public void surfaceDestroyed(SurfaceHolder holder)
{
mCamera.stopPreview();
mPreviewRunning = false;
mCamera.release();
}
private SurfaceView mSurfaceView;
private SurfaceHolder mSurfaceHolder;
public void onAutoFocus(boolean success, Camera camera)
{
camera.takePicture(null, null, this);
}
private static String file_name = "temp_img";
public void onPictureTaken(byte[] data, Camera camera)
{
// Matrix m = new Matrix();
// m.postRotate(90);
// Bitmap nb = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(),
// m, true);
try
{
FileOutputStream fos = openFileOutput(file_name, MODE_PRIVATE);
fos.write(data);
fos.close();
} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
Intent i = new Intent(this, PhotoEditActivity.class);
i.putExtra("data", file_name);
this.finish();
startActivity(i);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_CAMERA)
{
mCamera.autoFocus(this);
return true;
}
return super.onKeyDown(keyCode, event);
}
}
po...@gmail.com <po...@gmail.com> #24
[Comment deleted]
po...@gmail.com <po...@gmail.com> #25
It is occurring in 1.6 as well.
any ideas on when is the fix going to be released?
Has anyone found a workaround by using Intent - 'MediaStore.ACTION_IMAGE_CAPTURE' but
overriding "options.inSampleSize = 4;"
any ideas on when is the fix going to be released?
Has anyone found a workaround by using Intent - 'MediaStore.ACTION_IMAGE_CAPTURE' but
overriding "options.inSampleSize = 4;"
je...@gmail.com <je...@gmail.com> #26
When in Idle... I dont receive notifications for replies or mentions. And yes, the
settings are correct.
settings are correct.
sz...@gmail.com <sz...@gmail.com> #27
How is this issue marked as closed if it still exists?
to...@gmail.com <to...@gmail.com> #28
Looks like it's closed in the future - fixed in a future release
ma...@gmail.com <ma...@gmail.com> #29
Issue was closed as FutureRelease in Feb 2009 with this comment "This issue will be
addressed in the Cupcake release.".
Since it appears that the problem still exists, Google, please, can you re-open this
issue?
Thanks.
addressed in the Cupcake release.".
Since it appears that the problem still exists, Google, please, can you re-open this
issue?
Thanks.
ma...@gmail.com <ma...@gmail.com> #30
Just to clarify (reading all the comments, I feel this is needed):
=> we need an easy way to start a "take picture" activity that will return a
full-resolution image to the calling app.
This issue needs to be re-opened.
=> we need an easy way to start a "take picture" activity that will return a
full-resolution image to the calling app.
This issue needs to be re-opened.
m....@gmail.com <m....@gmail.com> #31
I don't really understand your problem. What exactly is it that's not working for
you? Do you want a high-res image to be returned in-memory? Why?
When specifying a temporary path for the image as described in the docs, I get a
478x359px JPEG. Sure, it's not HD, but it's good enough for a snapshot (considering
how bad the phone cameras typically are, more pixels probably won't buy you
anything).
Is that still too low res for you?
you? Do you want a high-res image to be returned in-memory? Why?
When specifying a temporary path for the image as described in the docs, I get a
478x359px JPEG. Sure, it's not HD, but it's good enough for a snapshot (considering
how bad the phone cameras typically are, more pixels probably won't buy you
anything).
Is that still too low res for you?
te...@gmail.com <te...@gmail.com> #32
"478x359px JPEG... Is that still too low res for you?" and "considering how bad
the phone cameras typically are"
Are you kidding? All of the new devices that Android is available on have at least
3 MP with auto-focus. It is becoming common to see 5 and 8 MP now. These devices
take very nice photos. My company (scanR) produces a product that requires the best
input possible. In fact, for most things we require a minimum of 3 MP.
Currently our Android application gets around this bug by laboriously implementing
our own custom camera capture app. This is far from ideal. The end user would
rather see the same camera application they are used to, rather than something
custom for our app.
Oh, and no, I don’t think anyone is asking to get 3 MP back in memory. We just want
SOME WAY to access the full resolution version of the image. Having a file path or
something similar returned from the Activity would be perfect.
the phone cameras typically are"
Are you kidding? All of the new devices that Android is available on have at least
3 MP with auto-focus. It is becoming common to see 5 and 8 MP now. These devices
take very nice photos. My company (scanR) produces a product that requires the best
input possible. In fact, for most things we require a minimum of 3 MP.
Currently our Android application gets around this bug by laboriously implementing
our own custom camera capture app. This is far from ideal. The end user would
rather see the same camera application they are used to, rather than something
custom for our app.
Oh, and no, I don’t think anyone is asking to get 3 MP back in memory. We just want
SOME WAY to access the full resolution version of the image. Having a file path or
something similar returned from the Activity would be perfect.
wr...@gmail.com <wr...@gmail.com> #33
Wanted to weigh in here with my experiences. I think the real bug is the 3M (or
whatever size) picture is not being written to the EXTRA_OUTPUT path discussed in the
documentation.
teatoalin is right; I do not believe anybody is expecting a full sized picture to
come back in memory.
whatever size) picture is not being written to the EXTRA_OUTPUT path discussed in the
documentation.
teatoalin is right; I do not believe anybody is expecting a full sized picture to
come back in memory.
m....@gmail.com <m....@gmail.com> #34
Just for the record, having a 8MP camera in a phone is just marketing hogwash, since
more pixels don't automatically make better pictures. The 3MP camera in my Magic is
complete rubbish, and that's not because it doesn't have a high enough resolution.
That aside, this ticket is about the image data returned *in memory* in the Activity
result, which is just a thumbnail. Maybe you want to open a new ticket as a feature
request to get the developers' attention.
more pixels don't automatically make better pictures. The 3MP camera in my Magic is
complete rubbish, and that's not because it doesn't have a high enough resolution.
That aside, this ticket is about the image data returned *in memory* in the Activity
result, which is just a thumbnail. Maybe you want to open a new ticket as a feature
request to get the developers' attention.
bo...@gmail.com <bo...@gmail.com> #35
m.kaeppler: thank you for your participation.
If you think accessing high resolution images is useless, maybe you shouldn't even
monitor this issue?
Also I really think opening a new issue is not a good idea as the previous comments
and information will be useful for the Android team to understand what this is really
about.
Google, please re-open this issue.
If you think accessing high resolution images is useless, maybe you shouldn't even
monitor this issue?
Also I really think opening a new issue is not a good idea as the previous comments
and information will be useful for the Android team to understand what this is really
about.
Google, please re-open this issue.
ma...@gmail.com <ma...@gmail.com> #36
This definitely needs to get fixed, unless google provides us with a simple code for a
camera, i've tried looking at the camera's source code before and it wasn't exactly
easy to understand. It took me some time to implement my own camera but now i have to
go through the same process with the video cam which is extremely annoying and holding
me back from proceeding.
Anyway, maybe its already late to ask for such a thing since most users out there are
1.6 and phones with later android releases are still a minority (and still will be for
a long time or at least a year ahead, anyway that's just a guess)
camera, i've tried looking at the camera's source code before and it wasn't exactly
easy to understand. It took me some time to implement my own camera but now i have to
go through the same process with the video cam which is extremely annoying and holding
me back from proceeding.
Anyway, maybe its already late to ask for such a thing since most users out there are
1.6 and phones with later android releases are still a minority (and still will be for
a long time or at least a year ahead, anyway that's just a guess)
ra...@gmail.com <ra...@gmail.com> #37
I am also developing an application in which I wish to use the camera to take
pictures. I would really like to have the following options, which I believe
summarize the various requirements I've read about in this thread.(I apologize if I
missed something.):
1) Take picture and return a small in memory pic that is the same size on all phones.
2) Take picture and return a picture that is SMALL, MEDIUM, or LARGE and placed
according to the URI I specify. SMALL, MEDIUM, and LARGE should all have the same
relationship to the maximum resolution on ALL phones. i.e, LARGE might be full res,
MEDIUM 1/2 and SMALL 1/4, or maybe 1:1, 1:4, and 1:16, not sure what makes most
sense.
3) Take picture and return it with the resolution set according to parameters passed
to the intent via PUT_EXTRA.
4) Take picture and return both the small in memory pic and the larger picture that
is written to a file.
pictures. I would really like to have the following options, which I believe
summarize the various requirements I've read about in this thread.(I apologize if I
missed something.):
1) Take picture and return a small in memory pic that is the same size on all phones.
2) Take picture and return a picture that is SMALL, MEDIUM, or LARGE and placed
according to the URI I specify. SMALL, MEDIUM, and LARGE should all have the same
relationship to the maximum resolution on ALL phones. i.e, LARGE might be full res,
MEDIUM 1/2 and SMALL 1/4, or maybe 1:1, 1:4, and 1:16, not sure what makes most
sense.
3) Take picture and return it with the resolution set according to parameters passed
to the intent via PUT_EXTRA.
4) Take picture and return both the small in memory pic and the larger picture that
is written to a file.
ra...@gmail.com <ra...@gmail.com> #38
In the 2.0 documentation of ACTION_IMAGE_CAPTURE, it has a See Also pointing to
EXTRA_VIDEO_QUALITY. I wonder if you set that to 1 if it will cause the camera to give
you a full size image? Would try it, but don't have actual phone hardware right now.
EXTRA_VIDEO_QUALITY. I wonder if you set that to 1 if it will cause the camera to give
you a full size image? Would try it, but don't have actual phone hardware right now.
be...@gmail.com <be...@gmail.com> #39
Hello everybody!
I am trying to save an image from my android application but it is still very small
even if I use the putExtra() method.
This is my code:
SimpleDateFormat timeStampFormat = new SimpleDateFormat("yyyyMMddHHmmssSS");
String filename = timeStampFormat.format(new Date());
ContentValues values = new ContentValues();
values.put(Media.TITLE, filename);
values.put(Media.DESCRIPTION, "Image from Android Emulator");
photoUri =
getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
startActivityForResult(inttPhoto, 0);
Any idea?
I am trying to save an image from my android application but it is still very small
even if I use the putExtra() method.
This is my code:
SimpleDateFormat timeStampFormat = new SimpleDateFormat("yyyyMMddHHmmssSS");
String filename = timeStampFormat.format(new Date());
ContentValues values = new ContentValues();
values.put(Media.TITLE, filename);
values.put(Media.DESCRIPTION, "Image from Android Emulator");
photoUri =
getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
startActivityForResult(inttPhoto, 0);
Any idea?
ma...@gmail.com <ma...@gmail.com> #40
How small (precisely)?
Also: did you read this issue? Summary: there is no way to get a full size image
using this Intent, you're going to have to develop your own camera-like activity.
Also: did you read this issue? Summary: there is no way to get a full size image
using this Intent, you're going to have to develop your own camera-like activity.
sa...@gmail.com <sa...@gmail.com> #41
Hello everyone,
on my motorola milestone with stock 2.0 (not 2.0.1) i can do the following:
Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File out = new File(Environment.getExternalStorageDirectory(), "camera.jpg");
Uri uri = Uri.fromFile(out);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
imageCaptureIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
startActivityForResult(imageCaptureIntent, RESULT_CAPTURE_IMAGE);
and i DO get 2592x1936 image (it's 600K only - but it's the same size as the one I
get from stock application shooting the same thing).
I can't test on my old G1 atm, but reading your comments I have a bad feeling that
this will not work there...
on my motorola milestone with stock 2.0 (not 2.0.1) i can do the following:
Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File out = new File(Environment.getExternalStorageDirectory(), "camera.jpg");
Uri uri = Uri.fromFile(out);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
imageCaptureIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
startActivityForResult(imageCaptureIntent, RESULT_CAPTURE_IMAGE);
and i DO get 2592x1936 image (it's 600K only - but it's the same size as the one I
get from stock application shooting the same thing).
I can't test on my old G1 atm, but reading your comments I have a bad feeling that
this will not work there...
ma...@gmail.com <ma...@gmail.com> #42
Very interesting sashomasho.
Can you tell us if this also works on a 2.0 emulator?
Can you tell us if this also works on a 2.0 emulator?
sa...@gmail.com <sa...@gmail.com> #43
2.0 emulator - 213x350 - using the method above
2.0 emulator - 213x350 - using the stock camera application, when I try to enter the
settings it Force-Closes, so no luck with changing them..
2.0 emulator - 213x350 - using the stock camera application, when I try to enter the
settings it Force-Closes, so no luck with changing them..
nt...@gmail.com <nt...@gmail.com> #44
It would seem that all AVD cameras have a resolution of 213x350, even if you enter
custom values for hw.camera.maxHorizontalPixels and hw.camera.maxVerticalPixels.
With a 1.6 emulator, the IMAGE_CAPTURE intent with an OUTPUT extra returns an image
of size 54x88 (1/4 full size). With a 2.0 emulator, the same intent returns an image
of size 213x350 (full size). I did not even need the VIDEO_QUALITY extra. Therefore
I believe this bug has been fixed in 2.0.
I will post back here when I get the chance to test on a real 2.0 device.
custom values for hw.camera.maxHorizontalPixels and hw.camera.maxVerticalPixels.
With a 1.6 emulator, the IMAGE_CAPTURE intent with an OUTPUT extra returns an image
of size 54x88 (1/4 full size). With a 2.0 emulator, the same intent returns an image
of size 213x350 (full size). I did not even need the VIDEO_QUALITY extra. Therefore
I believe this bug has been fixed in 2.0.
I will post back here when I get the chance to test on a real 2.0 device.
wr...@gmail.com <wr...@gmail.com> #45
My experience has been even with EXTRA_OUTPUT, you get low resolution images no
matter the device or firmware.
matter the device or firmware.
da...@gmail.com <da...@gmail.com> #46
I didn't see anyone note this here, but this may have changed in 2.0.1 (at least on
my Motorola Droid running 2.0.1). Note that I'm not using the emmulator, but running
on the actual device.
[code]
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(FILEPATH));
startActivityForResult(intent, 0);
[/code]
The image is written to the file (URI) at whatever resolution I have set within the
camera application. When the code above launches the camera app, I can open up the
camera app's settings and choose from three Picture Sizes: 5M, 3M, and 2M. If I
don't do this, it will use whatever size (of the three) that it had previously been
set to use.
When I press the shutter, and the the "OK" button in the camera app, the image is
stored to the file, even though my calling activity's onActivityResult method is
essentially empty.
Here are the dimensions of the photo (reported by "details" in the viewer) after
taking snaps at each size using the code above:
5M = 2592x1936
3M = 2048x1536
2M = 1600x1200
So, at least on my device, the intent causes the camera app to do what you would
expect. But (unless I'm doing something silly) there are a few gotchas:
1. The onActivityResult() in my calling program fires, but it is passed a null
intent (see below) or nothing.
2. There does not appear to be a way to set the size at which the photo is captured
before calling the intent.
Here's my onActivityResult method:
[code]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0 && resultCode == Activity.RESULT_OK) {
if (data == null) {
Log.v("Camera Result", "NO RETURNED INTENT");
return;
} else {
Log.v("Camera Result", "I GOT SOMETHING BACK!!!!");
return;
}
}
[/code]
The pieces of code above work. I get "NO RETURNED INTENT" logged, and I get the
photo stored to the file at whatever resolution the app is set to. I don't think
this is ideal, but it does work. I wish I could figure out how to set the camera
application's parameters before launching the intent, but no luck so far.
my Motorola Droid running 2.0.1). Note that I'm not using the emmulator, but running
on the actual device.
[code]
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(FILEPATH));
startActivityForResult(intent, 0);
[/code]
The image is written to the file (URI) at whatever resolution I have set within the
camera application. When the code above launches the camera app, I can open up the
camera app's settings and choose from three Picture Sizes: 5M, 3M, and 2M. If I
don't do this, it will use whatever size (of the three) that it had previously been
set to use.
When I press the shutter, and the the "OK" button in the camera app, the image is
stored to the file, even though my calling activity's onActivityResult method is
essentially empty.
Here are the dimensions of the photo (reported by "details" in the viewer) after
taking snaps at each size using the code above:
5M = 2592x1936
3M = 2048x1536
2M = 1600x1200
So, at least on my device, the intent causes the camera app to do what you would
expect. But (unless I'm doing something silly) there are a few gotchas:
1. The onActivityResult() in my calling program fires, but it is passed a null
intent (see below) or nothing.
2. There does not appear to be a way to set the size at which the photo is captured
before calling the intent.
Here's my onActivityResult method:
[code]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0 && resultCode == Activity.RESULT_OK) {
if (data == null) {
Log.v("Camera Result", "NO RETURNED INTENT");
return;
} else {
Log.v("Camera Result", "I GOT SOMETHING BACK!!!!");
return;
}
}
[/code]
The pieces of code above work. I get "NO RETURNED INTENT" logged, and I get the
photo stored to the file at whatever resolution the app is set to. I don't think
this is ideal, but it does work. I wish I could figure out how to set the camera
application's parameters before launching the intent, but no luck so far.
da...@gmail.com <da...@gmail.com> #47
Meant to mention in my previous comment that, while I am debugging on the Droid
running 2.0.1, I am targeting SDK 1.5 (v3) in my code. So at least in theory, I'm
not using any new API.
running 2.0.1, I am targeting SDK 1.5 (v3) in my code. So at least in theory, I'm
not using any new API.
nt...@gmail.com <nt...@gmail.com> #48
This is very good news David! Thanks for the info.
You are not using a new API in your compiled code, no, but you are using a Camera app
that was compiled with the new API and handles the same intent in a different way
than older versions of the Camera app.
You are not using a new API in your compiled code, no, but you are using a Camera app
that was compiled with the new API and handles the same intent in a different way
than older versions of the Camera app.
lj...@gmail.com <lj...@gmail.com> #49
I am running on 1.5 and have spent weeks trying to figure this out. I still only get
192x256 images no matter what I do. I have not even been able to get the image saved
to the sd card.. I thought it was due to permissions since no one mentions
the "android.permission.WRITE_EXTERNAL_STORAGE" permission, which I though was
responsible. Anyways... I think next step would be to analyze/debug the build-in
camera app...
192x256 images no matter what I do. I have not even been able to get the image saved
to the sd card.. I thought it was due to permissions since no one mentions
the "android.permission.WRITE_EXTERNAL_STORAGE" permission, which I though was
responsible. Anyways... I think next step would be to analyze/debug the build-in
camera app...
nt...@gmail.com <nt...@gmail.com> #50
@ljbotero
I don't mean to be rude, but you clearly haven't read all the comments here. Someone
DID debug the camera app, and they found that the image was being downsampled by
1/4th its original size.
Furthermore, this is fixed for 2.0 and above, but it will NEVER work for you while
running on 1.5. The only way would be if you could update the camera app on your 1.5
device. This would only be possible if the new camera app doesn't use any API calls
from 1.6 and above.
I don't mean to be rude, but you clearly haven't read all the comments here. Someone
DID debug the camera app, and they found that the image was being downsampled by
1/4th its original size.
Furthermore, this is fixed for 2.0 and above, but it will NEVER work for you while
running on 1.5. The only way would be if you could update the camera app on your 1.5
device. This would only be possible if the new camera app doesn't use any API calls
from 1.6 and above.
fl...@gmail.com <fl...@gmail.com> #51
I wrote a camera application that is now on the Market and is supported for 1.5 (and
up). My camera app will return the original full-sized image when the intent is only
interested in the content-uri. The app is called "Snap FX".
If the intent is interested in the actual binary bitmap-data, only a upto a 100K
bitmap is returned as a result.
up). My camera app will return the original full-sized image when the intent is only
interested in the content-uri. The app is called "Snap FX".
If the intent is interested in the actual binary bitmap-data, only a upto a 100K
bitmap is returned as a result.
nt...@gmail.com <nt...@gmail.com> #52
@flyingdutchie
Does your program support the same intent? If so, I will definitely use
createChooser() instead of sending the intent directly, to let users pick your camera
app instead. I could also do this if you support ACTION_GET_CONTENT with a MIME type
of image/*, like the image gallery does.
Does your program support the same intent? If so, I will definitely use
createChooser() instead of sending the intent directly, to let users pick your camera
app instead. I could also do this if you support ACTION_GET_CONTENT with a MIME type
of image/*, like the image gallery does.
fl...@gmail.com <fl...@gmail.com> #53
Snap FX will handle intents as follows, for both the camera and the gallery
component:
These intents will return you the content-Uri of the selected or captured full-sized
and original image.
- Intent.ACTION_PICK
- Intent.ACTION_GET_CONTENT
- MediaStore.ACTION_IMAGE_CAPTURE
If the "return-data" is set in the calling intent's extras, then it returns a Bitmap
as well (in "data"), but the bitmap will be scaled to be no more than 100KByte.
component:
These intents will return you the content-Uri of the selected or captured full-sized
and original image.
- Intent.ACTION_PICK
- Intent.ACTION_GET_CONTENT
- MediaStore.ACTION_IMAGE_CAPTURE
If the "return-data" is set in the calling intent's extras, then it returns a Bitmap
as well (in "data"), but the bitmap will be scaled to be no more than 100KByte.
bv...@gmail.com <bv...@gmail.com> #54
Hi FlyingDutchie, could you give a small example of how you get the full sized image
from the camera? Cause when I use MediaStore.ACTION_IMAGE_CAPTURE it still gives a
very small sized image back in memory, and puts a somewhat bigger (but still small)
image in my picture album (htc hero).
Thanks
from the camera? Cause when I use MediaStore.ACTION_IMAGE_CAPTURE it still gives a
very small sized image back in memory, and puts a somewhat bigger (but still small)
image in my picture album (htc hero).
Thanks
fl...@gmail.com <fl...@gmail.com> #55
Hi bvandepoel,
Apps that handle the ACTION_IMAGE_CAPTURE can do what however they like to do. I
guess that the stock camera app only returns smaller images, never full-sized ones.
My 'Snap FX' app, the Camera FX module, will return a Uri that points to the full-
sized image when it handles ACTION_IMAGE_CAPTURE. This Uri will be part of your
gallery (i.e. your phone's image content-provider).
If you specify 'return-data' in the extras, when you call the intent, it returns an
in-memory bitmap as well, like the stock camera application. However, just like the
stock camera app, this in-memory bitmap is never larger than 100K... quite small....
Apps that handle the ACTION_IMAGE_CAPTURE can do what however they like to do. I
guess that the stock camera app only returns smaller images, never full-sized ones.
My 'Snap FX' app, the Camera FX module, will return a Uri that points to the full-
sized image when it handles ACTION_IMAGE_CAPTURE. This Uri will be part of your
gallery (i.e. your phone's image content-provider).
If you specify 'return-data' in the extras, when you call the intent, it returns an
in-memory bitmap as well, like the stock camera application. However, just like the
stock camera app, this in-memory bitmap is never larger than 100K... quite small....
bv...@gmail.com <bv...@gmail.com> #56
Ah ok, I guess I misunderstood your previous post. So you are saying that to do it, I
would have to download your application and call your intent from my application?
Thanks
would have to download your application and call your intent from my application?
Thanks
fl...@gmail.com <fl...@gmail.com> #57
Yes. :)
There may be some other apps on the Market that can do the same thing (i.e.
returning a Uri to a *full-sized* image instead of a scaled one), but i'm not aware
of them.
There may be some other apps on the Market that can do the same thing (i.e.
returning a Uri to a *full-sized* image instead of a scaled one), but i'm not aware
of them.
nt...@gmail.com <nt...@gmail.com> #58
I would like to stress again to new viewers of this issue: the built-in Android Camera
app DOES return a full-sized image in SDK 2.0 and above. For SDKs 1.6 and older
(Donut, Cupcake, and 1.0), the Camera returns an image which is 1/4 full size.
So if you only plan to support 2.0 and above, you do not need to roll your own camera
activity.
app DOES return a full-sized image in SDK 2.0 and above. For SDKs 1.6 and older
(Donut, Cupcake, and 1.0), the Camera returns an image which is 1/4 full size.
So if you only plan to support 2.0 and above, you do not need to roll your own camera
activity.
bv...@gmail.com <bv...@gmail.com> #59
Do you know if 2.0 supports it for all phones? My htc hero now stores the 1/4 image on
the sd card (but not where I specified that it should put it), and returns an even smaller
image in memory. For 2.0 and up, is it uniformly supported for all phones?
the sd card (but not where I specified that it should put it), and returns an even smaller
image in memory. For 2.0 and up, is it uniformly supported for all phones?
nt...@gmail.com <nt...@gmail.com> #60
I've confirmed this on Nexus, Droid, and emulators >= 2.0. Unless a manufacturer
decides to install a custom Camera app, you can assume that this will work for all 2.0
devices.
If a manufacturer does replace the Camera app, there's no guarantee that it will even
handle the same intents as the Google Camera app, but it should if they know what
they're doing.
decides to install a custom Camera app, you can assume that this will work for all 2.0
devices.
If a manufacturer does replace the Camera app, there's no guarantee that it will even
handle the same intents as the Google Camera app, but it should if they know what
they're doing.
bv...@gmail.com <bv...@gmail.com> #61
Ok thanks. May I ask how you tested it on the emulator? I always get a low resolution
android logo. I also saw some custom code to use your webcam as camera in the
emulator, but it looked like you had to define your own camera code instead of using a
standard intent.
android logo. I also saw some custom code to use your webcam as camera in the
emulator, but it looked like you had to define your own camera code instead of using a
standard intent.
nt...@gmail.com <nt...@gmail.com> #62
I just tested it with the emulator's built-in camera app, which always produces a stock
image of 213x350 pixels. See comment #45 for my explanation.
image of 213x350 pixels. See
da...@gmail.com <da...@gmail.com> #64
Tested on my HTC Desire with 2.1, the picture size is 384x640 :-(
m....@gmail.com <m....@gmail.com> #65
why "reintroduced"? has it ever been fixed for any device or Android release?
nt...@gmail.com <nt...@gmail.com> #66
It was fixed on 2.0. Read comments #45 and #47.
kl...@gmx.at <kl...@gmx.at> #67
Nexus One (2.1-update1): 5M (2592 x 1552)
HTC Desire (2.1-update1): 640 x 384
And yes, I also tested it with Motorla Milesone with 2.0.1 which worked.
I'm totally confused!
HTC Desire (2.1-update1): 640 x 384
And yes, I also tested it with Motorla Milesone with 2.0.1 which worked.
I'm totally confused!
al...@gmail.com <al...@gmail.com> #68
any workarounds for the htc not-very-incredible? as far as i can tell it doesn't even
put the orientation in the exif, so even if you can deal with the resolution you are
still well and truly hosed.
-alex
put the orientation in the exif, so even if you can deal with the resolution you are
still well and truly hosed.
-alex
ch...@gmail.com <ch...@gmail.com> #69
[Comment deleted]
ch...@gmail.com <ch...@gmail.com> #70
[Comment deleted]
ch...@gmail.com <ch...@gmail.com> #71
Has anyone considered to let Android store the image to
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
and then query it afterwards?
I used this code
http://achorniy.wordpress.com/2010/04/26/howto-launch-android-camera-using-intents/
and now I'm trying to copy the pic in the onActivityResult.
I keep the image uri and title as a global variable.
Then I call getBitmap on MediaStore.Images.Media afterwards using the uri and finally delete it from MediaStore by finding it using the title.
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
and then query it afterwards?
I used this code
and now I'm trying to copy the pic in the onActivityResult.
I keep the image uri and title as a global variable.
Then I call getBitmap on MediaStore.Images.Media afterwards using the uri and finally delete it from MediaStore by finding it using the title.
ch...@gmail.com <ch...@gmail.com> #72
Yeah, it worked pretty well in the emulator, but this:
Tested on my HTC Desire with 2.1, the picture size is 384x640 :-(
I can't change the resolution to anything larger in the settings panel.
Tested on my HTC Desire with 2.1, the picture size is 384x640 :-(
I can't change the resolution to anything larger in the settings panel.
mg...@gmail.com <mg...@gmail.com> #73
chrilyng,
I tried the same approach (running a query in MediaStore.Images.Media.EXTERNAL_CONTENT_URI based on date) on HTC Magic 1.5 with Sense UI. I got the same small image.
Does the device you tested on also have the Sense UI?
-Michalis
I tried the same approach (running a query in MediaStore.Images.Media.EXTERNAL_CONTENT_URI based on date) on HTC Magic 1.5 with Sense UI. I got the same small image.
Does the device you tested on also have the Sense UI?
-Michalis
nt...@gmail.com <nt...@gmail.com> #74
[Comment deleted]
du...@gmail.com <du...@gmail.com> #75
this is so frustrating!! google fix it!!!!!
I want a big image from the camera for my application! is this not too much to ask for!!??
at least give me the freakin path that the big image is saved to on the sd card!? surely!?
I want a big image from the camera for my application! is this not too much to ask for!!??
at least give me the freakin path that the big image is saved to on the sd card!? surely!?
jo...@gmail.com <jo...@gmail.com> #76
There is a massive amount of confusion surrounding this bug, can someone please clear it up?
I'm hearing we should wait for v2, well, that isn't an option because 1.6 handsets are still being sold & shipped. Then I'm hearing its broken in 2.1.
A few specific questions that I believe Google should answer with a simple yes/no response:
Are all handsets running less than 1.6 troubled by this bug?
Are all handsets running v2+ free of this bug?
Is there a fix that doesn't require a third party app?
So let's clear this up: If the code is broken is broken in 1.5+ then a minor update should be pushed out to fix this issue.
1000's of children's school assessments are depending on it being resolved so please look into it.
I'm hearing we should wait for v2, well, that isn't an option because 1.6 handsets are still being sold & shipped. Then I'm hearing its broken in 2.1.
A few specific questions that I believe Google should answer with a simple yes/no response:
Are all handsets running less than 1.6 troubled by this bug?
Are all handsets running v2+ free of this bug?
Is there a fix that doesn't require a third party app?
So let's clear this up: If the code is broken is broken in 1.5+ then a minor update should be pushed out to fix this issue.
1000's of children's school assessments are depending on it being resolved so please look into it.
ru...@gmail.com <ru...@gmail.com> #77
johnyma22:
(I'm not a Google employee or contributor to Android)
Are all handsets running less than 1.6 troubled by this bug? YES
Are all handsets running v2+ free of this bug? SOME
The bug was fixed in plain vanilla Android 2.0 (e.g. on an N1).
Part of the confusion is that the HTC Sense UI and the Samsung and Motorola custom UIs re-introduce this bug because they provide their own custom Camera application, which often times does not even accept the EXTRA_OUTPUT intent, and if it does, returns a tiny image as in Android 1.5.
As in Comment #64 , barking at Google about this is pointless. The person you need to be hounding is the creator of the impaired UI that came with your phone.
As an Android developer, this is easily the worst part of Android.
(I'm not a Google employee or contributor to Android)
Are all handsets running less than 1.6 troubled by this bug? YES
Are all handsets running v2+ free of this bug? SOME
The bug was fixed in plain vanilla Android 2.0 (e.g. on an N1).
Part of the confusion is that the HTC Sense UI and the Samsung and Motorola custom UIs re-introduce this bug because they provide their own custom Camera application, which often times does not even accept the EXTRA_OUTPUT intent, and if it does, returns a tiny image as in Android 1.5.
As in
As an Android developer, this is easily the worst part of Android.
ki...@gmail.com <ki...@gmail.com> #78
Being affected by this issue, I think GOOG should give fair warning in the docs as to the instability of this call. To draw insight from another context:
“RT @RealTalibKweli: Advice for new artists- whatever shenanigans your dj, tour mgr etc get into will be blamed on you. Keep your team tight.”
“RT @RealTalibKweli: Advice for new artists- whatever shenanigans your dj, tour mgr etc get into will be blamed on you. Keep your team tight.”
bo...@gmail.com <bo...@gmail.com> #79
hmmm... "ok".
gu...@gmail.com <gu...@gmail.com> #80
I did something in a project to avoid this kind of problem.
Now, even using MediaStore to capture the picture, i got the original picture.
When you use Mediastore, android leave the original picture in the "/sdcard/DCIM".
Maybe can work for someone.
You can check in my blog:
http://gcoutinho.wordpress.com/2010/10/07/trabalhando-com-fotos-no-android/
in portuguese! =D
Now, even using MediaStore to capture the picture, i got the original picture.
When you use Mediastore, android leave the original picture in the "/sdcard/DCIM".
Maybe can work for someone.
You can check in my blog:
in portuguese! =D
nt...@gmail.com <nt...@gmail.com> #81
In reference to the above comment:
I can't read Portuguese, but based on what I can tell from that blog post, that is not a good solution. If you want to grab images from the user's gallery, then you should be using the MediaStore as a ContentProvider, not pulling images directly from disk.
Or, if you do want to pull the images directly from disk, you should at least get the MediaStore to give you a URI instead of using a hard-coded value. There's nothing to say that an OEM can't change the location of the image storage. You can let your user select an image by calling startActivityForResult with this Intent:
Intent selectImg = new Intent(Intent.ACTION_GET_CONTENT);
selectImg.setType("image/*");
And then you can grab the image in your onActivityResult method like so:
Uri imageUri = data.getData();
InputStream instream = getContentResolver().openInputStream(mMediaImageUri);
Bitmap image = BitmapFactory.decodeStream(input);
I can't read Portuguese, but based on what I can tell from that blog post, that is not a good solution. If you want to grab images from the user's gallery, then you should be using the MediaStore as a ContentProvider, not pulling images directly from disk.
Or, if you do want to pull the images directly from disk, you should at least get the MediaStore to give you a URI instead of using a hard-coded value. There's nothing to say that an OEM can't change the location of the image storage. You can let your user select an image by calling startActivityForResult with this Intent:
Intent selectImg = new Intent(Intent.ACTION_GET_CONTENT);
selectImg.setType("image/*");
And then you can grab the image in your onActivityResult method like so:
Uri imageUri = data.getData();
InputStream instream = getContentResolver().openInputStream(mMediaImageUri);
Bitmap image = BitmapFactory.decodeStream(input);
gu...@gmail.com <gu...@gmail.com> #82
In reply to the above comment:
I tried to get URI from MediaStore but i didn't find where i can get. So, you can tell me.
In a project that i have been working, the best way was to pull the image from gallery to the SD. In my case, we can't let the user select any image. Even though, i appreciate your tips.
I am new developing from android... i knew that the code would be better.
I will try to use MediaStore as a ContentProvider.
thanks
I tried to get URI from MediaStore but i didn't find where i can get. So, you can tell me.
In a project that i have been working, the best way was to pull the image from gallery to the SD. In my case, we can't let the user select any image. Even though, i appreciate your tips.
I am new developing from android... i knew that the code would be better.
I will try to use MediaStore as a ContentProvider.
thanks
nt...@gmail.com <nt...@gmail.com> #83
@GugaRush
Admittedly, I've always had the user select a picture through the above mechanism. I've never just pulled the first picture. Still, I'm thinking that maybe you can get the MediaStore to tell you the most recent picture if you sort by the DATE_ADDED or DATE_MODIFIED column? I've not tried it, but I'm thinking something like this:
Cursor imgCursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new String[]{BaseColumns._ID, MediaStore.MediaColumns.DATE_ADDED}, null, null, MediaStore.MediaColumns.DATE_ADDED + " DESC");
Then you could pull the _ID of the first row and obtain the final URI like so:
imgCursor.moveToFirst();
int idColumn = imgCursor.getColumnIndex(BaseColumns._ID);
String imgId = imgCursor.getString(idColumn);
Uri imgUri = Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imgId);
Also, sorry if I came off condescending, but you really don't want to assume you know where the images are stored, because any OEM can change this location on a whim, and if they do it'll give you a lot of headaches in the future.
If you want to continue the discussion, we should do it on Stack Overflow, not here.
Admittedly, I've always had the user select a picture through the above mechanism. I've never just pulled the first picture. Still, I'm thinking that maybe you can get the MediaStore to tell you the most recent picture if you sort by the DATE_ADDED or DATE_MODIFIED column? I've not tried it, but I'm thinking something like this:
Cursor imgCursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new String[]{BaseColumns._ID, MediaStore.MediaColumns.DATE_ADDED}, null, null, MediaStore.MediaColumns.DATE_ADDED + " DESC");
Then you could pull the _ID of the first row and obtain the final URI like so:
imgCursor.moveToFirst();
int idColumn = imgCursor.getColumnIndex(BaseColumns._ID);
String imgId = imgCursor.getString(idColumn);
Uri imgUri = Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imgId);
Also, sorry if I came off condescending, but you really don't want to assume you know where the images are stored, because any OEM can change this location on a whim, and if they do it'll give you a lot of headaches in the future.
If you want to continue the discussion, we should do it on Stack Overflow, not here.
sc...@gmail.com <sc...@gmail.com> #84
hi~ guys! I`m rookie in android programming and have encountered the same problem.
I got full-sized image on my HTC desire but a small one on Milestone with android 2.2.
I read all the comments carefully and I think it maybe the problem of android vendors, since they implement their own android os, which may not be corresponding to the official API doc.
Please correct me if I was wrong!
PS: wish to be your friends, here`s my msn and facebook account: mathcat@live.cn.
I got full-sized image on my HTC desire but a small one on Milestone with android 2.2.
I read all the comments carefully and I think it maybe the problem of android vendors, since they implement their own android os, which may not be corresponding to the official API doc.
Please correct me if I was wrong!
PS: wish to be your friends, here`s my msn and facebook account: mathcat@live.cn.
vi...@gmail.com <vi...@gmail.com> #86
Hey.. Tested the same on Samsung Galaxy Fit running Android 2.2
Here goes my code
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(intent, CAMERA);
The image gets stored to the desired location with the resolution that i set in the camera settings. So its working fine for me. Though not yet tried on any other phone.
But, onActivityResult always returns a null value for intent. Dont know why is that.
Any clue?
Here goes my code
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(intent, CAMERA);
The image gets stored to the desired location with the resolution that i set in the camera settings. So its working fine for me. Though not yet tried on any other phone.
But, onActivityResult always returns a null value for intent. Dont know why is that.
Any clue?
[Deleted User] <[Deleted User]> #87
ad #87:
Know that vendors implement this differently on different handsets, so it could well only be "fixed" for you on the specific Samsung device you're testing on. I spent a FAIR amount of time looking into this issue on all sorts of different devices, and came to the conclusion that it requires a custom wrapper that makes sure it's actually working on all devices and platform versions you target. For instance, Sony/Ericsson devices running Gingerbread behave differently from a Nexus S running on the exact same API level. The T-Mobile Pulse also had notorious issues with camera uploads, since it didn't even store images in the same location as virtually all other Android phones!
We use an IntentService to upload the photos, I've gist'ed its onHandleIntent() method which outlines the logic we use. Works well so far, with a few issues left (for instance, really old devices like the G1 don't rotate images properly that are taken in landscape mode). Basically what we do is writing to a temporary file, then moving it to a custom photo bucket (and giving it a proper name including a timestamp), and finally insert a record for it in the media DB.
https://gist.github.com/1042424
Know that vendors implement this differently on different handsets, so it could well only be "fixed" for you on the specific Samsung device you're testing on. I spent a FAIR amount of time looking into this issue on all sorts of different devices, and came to the conclusion that it requires a custom wrapper that makes sure it's actually working on all devices and platform versions you target. For instance, Sony/Ericsson devices running Gingerbread behave differently from a Nexus S running on the exact same API level. The T-Mobile Pulse also had notorious issues with camera uploads, since it didn't even store images in the same location as virtually all other Android phones!
We use an IntentService to upload the photos, I've gist'ed its onHandleIntent() method which outlines the logic we use. Works well so far, with a few issues left (for instance, really old devices like the G1 don't rotate images properly that are taken in landscape mode). Basically what we do is writing to a temporary file, then moving it to a custom photo bucket (and giving it a proper name including a timestamp), and finally insert a record for it in the media DB.
vi...@gmail.com <vi...@gmail.com> #88
@88
yup agreed.. Tried the same on Motorola Milestone XT720.
Pic is getting clicked at 1MP only i.e. 640 x 480 resolution.
Even i tried to implement the camera on my on using the surface and all but it had the ratation issue as well. Tried working out on it but couldnt get very far. So i jumped to this method.. Lets see what happens.. I have my fingers crossed :|
yup agreed.. Tried the same on Motorola Milestone XT720.
Pic is getting clicked at 1MP only i.e. 640 x 480 resolution.
Even i tried to implement the camera on my on using the surface and all but it had the ratation issue as well. Tried working out on it but couldnt get very far. So i jumped to this method.. Lets see what happens.. I have my fingers crossed :|
da...@gmail.com <da...@gmail.com> #89
So I've read through the entirety of this (nearly three years old!) thread and I'm still not too sure about a cross-device approach to using the camera intent to:
- take a picture
- retrieve location of said picture
- display thumbnail of said picture
Can anyone reference an approach that works across devices (2.2 or above)? There is a ton of different information out there solving different parts of the same puzzle but no definitive solution that works for all Android devices (even with hacks/workarounds).
Can anyone help?
- take a picture
- retrieve location of said picture
- display thumbnail of said picture
Can anyone reference an approach that works across devices (2.2 or above)? There is a ton of different information out there solving different parts of the same puzzle but no definitive solution that works for all Android devices (even with hacks/workarounds).
Can anyone help?
jo...@gmail.com <jo...@gmail.com> #90
hi...@gmail.com <hi...@gmail.com> #91
I am facing the same problem on my Motorola Droid X running android 2.3.3
If I start the camera intent without EXTRA_OUTPUT it works fine and gives the Bitmap through intent returned in onActivityResult.
But if I putExtra EXTRA_OUTPUT in the intent to start camera activity then in onActivityResult the intent is returned as NULL.
Although it works fine for me on HTC EVO 3D. But the image is stored at both the default gallery location and location specified in EXTRA_OUTPUT.
Anyone ?
If I start the camera intent without EXTRA_OUTPUT it works fine and gives the Bitmap through intent returned in onActivityResult.
But if I putExtra EXTRA_OUTPUT in the intent to start camera activity then in onActivityResult the intent is returned as NULL.
Although it works fine for me on HTC EVO 3D. But the image is stored at both the default gallery location and location specified in EXTRA_OUTPUT.
Anyone ?
da...@gmail.com <da...@gmail.com> #92
same problem as Himanshu on Samsung Galaxy Mini....
de...@gmail.com <de...@gmail.com> #93
i am using
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
_iem.listenForCameraEvents();
startActivityForResult(intent, CAMERA_PICTURE);
to take picture from default camera it is working fine for Htc Desire HD. but giving problem in samsung galaxy here image is not saved in sd card no exception formed in onActivityResult() any idea what is exact problem
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
_iem.listenForCameraEvents();
startActivityForResult(intent, CAMERA_PICTURE);
to take picture from default camera it is working fine for Htc Desire HD. but giving problem in samsung galaxy here image is not saved in sd card no exception formed in onActivityResult() any idea what is exact problem
re...@gmail.com <re...@gmail.com> #94
I am a similar issue.
My camera code works fine on 2.3.3 galaxy S2.
But in ICS 4.0 galaxy S2, the picture taken from camera is damaged.
Does someone know about this issue?
My camera code works fine on 2.3.3 galaxy S2.
But in ICS 4.0 galaxy S2, the picture taken from camera is damaged.
Does someone know about this issue?
pe...@gmail.com <pe...@gmail.com> #95
Seems like adding
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
besides EXTRA_OUTPUT
did make camera return high resolution pictures as on my Galaxy Nexus
The trick is to create a file in external storage directory like this:
imageFile = new File(Environment.getExternalStorageDirectory(), "newstake.jpg");
then pass the Uri from the file into EXTRA_OUTPUT
Hope this trick does help.
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
besides EXTRA_OUTPUT
did make camera return high resolution pictures as on my Galaxy Nexus
The trick is to create a file in external storage directory like this:
imageFile = new File(Environment.getExternalStorageDirectory(), "newstake.jpg");
then pass the Uri from the file into EXTRA_OUTPUT
Hope this trick does help.
[Deleted User] <[Deleted User]> #96
On 'Redmi 2' running android 4.4.4 when capturing image using custom camera it returns very low resulation image 176 × 144 size, but same code is working properly on all other Android devices.
If Anyone knows solution of this issue using custom camera, please help me ?
If Anyone knows solution of this issue using custom camera, please help me ?
[Deleted User] <[Deleted User]> #97
ok done setPictureSize() required for redmi 2
Description
Intent i = new Intent("android.media.action.IMAGE_CAPTURE");
this.startActivityForResult(i, MainMenu2.REQUEST_CAMERA);
The data returned in extras is of a terrible resolution (in onActivityResult):
Bitmap bmp = (Bitmap) extras.get("data");
bmp.getWidth() == 192 // WOW!
bmp.getHeight() == 256 // WOW!
This is an unacceptable size for an image, and is mostly useless. I would
implement my own picture-taking view, but the camera interface for the G1
has so many outstanding issues that I'm sure that the code won't work on
any other hardware (which is the point of a mobile platform, eh?).
Thanks for all of your hard work, if there's anything I can do to help out
with this (or other camera related issue) let me know.