code: public static Bitmap decodeSampledBitmapFromByteArray(byte[] picture,
                                                            int reqWidth, int reqHeight) {
  
          // First decode with inJustDecodeBounds=true to check dimensions
          BitmapFactory.Options options = new BitmapFactory.Options();
          options.inJustDecodeBounds = true;
          BitmapFactory.decodeByteArray(picture, 0, picture.length, options);
  
          // Calculate inSampleSize
          options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
  
          // Decode bitmap with inSampleSize set
          options.inJustDecodeBounds = false;
          return BitmapFactory.decodeByteArray(picture, 0, picture.length, options);
      }
docs: From the google examples, decodes a bitmap as a byte array and then resizes it for the required
  width and hieght.
  
  @param picture   the picture byte array
  @param reqWidth  the required width
  @param reqHeight the required height
  @return a Bitmap