title: Camera Capture Image is not clear(Blurry) in Android
body: <p>I Have a Problem with the Camera Capture Image.its set blurry.</p>
  
  <p>I searched lots of but i can't Get Solutions</p>
  
  <p>I don't know How to solve issue</p>
  
  <p>Here is My Code Which i Used For Camera Capture Image</p>
  
  <pre><code> @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      if (resultCode == Activity.RESULT_OK) {
          if (requestCode == SELECT_FILE)
              onSelectFromGalleryResult(data);
          else if (requestCode == REQUEST_CAMERA)
              onCaptureImageResult(data);
      }
  }
  
  private void onCaptureImageResult(Intent data) {
      Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
      thumbnail.compress(Bitmap.CompressFormat.JPEG, 0, bytes);
  
      File destination = new File(Environment.getExternalStorageDirectory(),
              System.currentTimeMillis() + ".jpg");
  
      FileOutputStream fo;
      try {
          destination.createNewFile();
          fo = new FileOutputStream(destination);
          fo.write(bytes.toByteArray());
          fo.close();
      } catch (FileNotFoundException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
  
    img1.setImageBitmap(thumbnail);
  }
  
  @SuppressWarnings("deprecation")
  private void onSelectFromGalleryResult(Intent data) {
      Uri selectedImageUri = data.getData();
      String[] projection = {MediaStore.MediaColumns.DATA};
      Cursor cursor = managedQuery(selectedImageUri, projection, null, null,
              null);
      int column_index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);
      cursor.moveToFirst();
  
      String selectedImagePath = cursor.getString(column_index);
  
      Bitmap bm;
      BitmapFactory.Options options = new BitmapFactory.Options();
      options.inJustDecodeBounds = true;
      BitmapFactory.decodeFile(selectedImagePath, options);
      final int REQUIRED_SIZE = 200;
      int scale = 1;
      while (options.outWidth / scale / 2 &gt;= REQUIRED_SIZE
              &amp;&amp; options.outHeight / scale / 2 &gt;= REQUIRED_SIZE)
          scale *= 2;
      options.inSampleSize = scale;
      options.inJustDecodeBounds = false;
      bm = BitmapFactory.decodeFile(selectedImagePath, options);
  
      img1.setImageBitmap(bm);
  
  }
  </code></pre>
  
  <p>The Gallery Image Set Good in Imageview But Its Only Happen with the CameraCapture Imageview
  <a href="https://stackoverflow.com/questions/34229811/camera-capture-image-is-not-clearblurry-in-android">Camera Capture Image is not clear(Blurry) in Android</a></p>
  
  <p>Help Me for this issue.</p>
  
  <p>Thanks In Advance</p>