I'm trying to take a picture from device camera or pick it up from the gallery and upload it to the server via the volley
everything works fine but the image quality is so bad

```
private void dispatchTakePictureIntent()
{
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(intent , CAMERA_REQUEST_CODE);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data { 
    switch (requestCode) {
    case CAMERA_REQUEST_CODE:
    if ( resultCode == RESULT_OK){                 
    Bundle bundle = data.getExtras();
    bitmap = (Bitmap) bundle.get("data");
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);                    
}
break;

```

and getParams method :

```
    byte[] a = convertBitmapToByteArrayUncompressed(bitmap);
    params.put("img" , Base64.encodeToString(a , Base64.DEFAULT));

public static byte[] convertBitmapToByteArrayUncompressed(Bitmap bitmap){
    ByteBuffer byteBuffer = ByteBuffer.allocate(bitmap.getByteCount());
    bitmap.copyPixelsToBuffer(byteBuffer);
    byteBuffer.rewind();
    return byteBuffer.array();
}

```