Getting nullpointerexception for bitmap.getWidth() when reading image from sdcard
===

I read an image from sd card with BitmapFactory:

    String myJpgPath = "/sdcard/yourdollar/img001.jpg"; 
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inSampleSize = 2;
    Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);

If I write: 

    Log.i("width and height: ", bm.getWidth() + " " + bm.getHeight());

I get a nullpointer exception. I tried to scale with `Bitmap.createScaledBitmap()` but I get the same error. After it I am processing the bitmap so I would like to have a bitmap in the end that has any width or height, because it seems like I didn't give parameters for the bitmap. But I cannot scale it, so how can I get this image as a bitmap with a width of 500 and a height of 500?

Any suggestion?