Hi,

I am uploading images to our webservice from the phone, and thus I
need to know the exact size of an image. I noticed that with some
photos from the G1, the webservice always failed, and found out that
it's due to the file size always being 0 for the latest image in the
database.

Is this a known bug? What else can I do to find out the size of an
image on the phone without going through the DB? I want to avoid
writing the whole image to a byte buffer just to find out its size...

here is some code to play with:

                ContentResolver contentResolver = getContentResolver
();
                Cursor c = contentResolver.query(
                        Uri.parse("content://media/external/images/
media"),
                        new String[] { Images.ImageColumns._ID,
                                Images.ImageColumns.DISPLAY_NAME,
                                Images.ImageColumns.SIZE }, null,
null, null);
                while (c.moveToNext()) {
                    Log.d("PHOTO", c.getLong(0) + " " + c.getString(1)
+ " "
                            + c.getLong(2));
                }
                c.close();

This gives me 0 in the third column for the last entry (that's the
newest photo).
--~--~---------~--~----~------------~-------~--~----~
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