title: MediaStore get Image height/width
body: <p>I'm querying <code>MediaStore.Images.Media.EXTERNAL_CONTENT_URI</code> and the query works fine. I'm able to get the data from every column that has a constant, for example: </p>
  
  <pre><code>currentImage.ImageUrl = imagecursor.getString(imagecursor.getColumnIndex(MediaStore.Images.Media.DATA));
              currentImage.Lat = imagecursor.getString(imagecursor.getColumnIndex(MediaStore.Images.Media.LATITUDE));
              currentImage.Long = imagecursor.getString(imagecursor.getColumnIndex(MediaStore.Images.Media.LONGITUDE));
  </code></pre>
  
  <p>The width/height columns has no constant (no <code>MediaStore.Images.Media.WIDTH</code>) so I'm trying to access them with <code>imagecursor.getLong(imagecursor.getColumnIndex("width"));</code>.</p>
  
  <p>Tried to use getLong, getString, getInt... nothing - always the same crash.</p>
  
  <p>Here's the stack:</p>
  
  <pre><code>02-22 19:38:26.242: E/AndroidRuntime(1607): FATAL EXCEPTION: main
  02-22 19:38:26.242: E/AndroidRuntime(1607): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.MEDIA_SCANNER_FINISHED dat=file:///mnt/sdcard flg=0x10 } in com.Activity.android.chat.service.ChatService$ChatServiceReceiver@415b26c0
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:737)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.os.Handler.handleCallback(Handler.java:605)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.os.Handler.dispatchMessage(Handler.java:92)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.os.Looper.loop(Looper.java:137)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at java.lang.reflect.Method.invoke(Method.java:511)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at dalvik.system.NativeStart.main(Native Method)
  02-22 19:38:26.242: E/AndroidRuntime(1607): Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.database.CursorWindow.nativeGetLong(Native Method)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.database.CursorWindow.getLong(CursorWindow.java:515)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.database.CursorWindow.getInt(CursorWindow.java:582)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:69)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.database.CursorWrapper.getInt(CursorWrapper.java:102)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at com.Activity.android.chat.service.ChatService.getUserImages(ChatService.java:251)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at com.Activity.android.chat.service.ChatService.access$1(ChatService.java:209)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at com.Activity.android.chat.service.ChatService$ChatServiceReceiver.onReceive(ChatService.java:204)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
  02-22 19:38:26.242: E/AndroidRuntime(1607):     ... 9 more
  </code></pre>
  
  <p>Would appreciate any help with this... have no idea what else can I try.</p>
  
  <p>Thank you!</p>