title: poor image quality after saving rotated bitmap to sdcard
body: <p>I am making an app where in one of the activity i am fetching image from gallery and showing it in adapter like image below</p>
  
  <p><img src="https://i.stack.imgur.com/8Goeg.jpg" alt="enter image description here"></p>
  
  <p>I have to rotate that image and save it to sdcard. My code is doing fine but after saving it to sdcard i get very poor quality of image. my code is:</p>
  
  <pre><code> viewHolder.imgViewRotate.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              imagePosition = (Integer) v.getTag();
              Matrix matrix = new Matrix();
              matrix.postRotate(90);
  
              Bitmap rotated = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
  
              try {
                  FileOutputStream out = new FileOutputStream(new File(uriList.get(rotatePosition).toString()));
                  rotated.compress(Bitmap.CompressFormat.PNG, 100, out);
                  out.close();
              } catch (Exception e) {
                  e.printStackTrace();
              }
  
              notifyDataSetChanged();
  
          }
      });
  </code></pre>
  
  <p>Any suggestions will be great help.</p>