This is turning out to be very difficult problem. I found a solution to one 
part of my problem by reading Android's gallery app's source. When I get the 
picture from gallery it works. This is a code snippet from my 
onActivityResult()

                                        final Uri imageUri = data.getData();

                    String[] columns = {MediaStore.Images.Media.DATA, 
MediaStore.Images.Media.ORIENTATION};

                    Cursor cursor = getContentResolver().query(imageUri, 
columns, null, null, null);


                    if (cursor == null) {

                        return;
                    }

                    cursor.moveToFirst();

                    int columnIndex = cursor.getColumnIndex(columns[0]);
                    int orientationColumnIndex = 
cursor.getColumnIndex(columns[1]);


                    String filePath = cursor.getString(columnIndex);
                    int orientation = cursor.getInt(orientationColumnIndex);

                    Log.d(TAG, "got image orientation "+orientation);

This works and I get correct orientation information on phones that don't 
rotate the image automatically.


However! This approach does not work when I get the image directly from 
camera intent. I can still run the same query with the camera intent uri but 
the orientation column is always 0 regardless of the orientation. 
Do someone know how I could get the image orientation from camera intent? 

Any help very much appreciated! Thank you.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to