title: ExifInterface FileNotFoundException /storage/emulated/0/DCIM/Camera/IMG_20200319_211738.jpg
body: <p>After capturing an image from the Android Emulator in Android Studio i get a content URI and through that i want to proccess the Image. One of that proccess is that i want to modify the orientation. So i have a function that does that</p>
  
  <pre><code>@Throws(IOException::class)
      fun modifyOrientation(bitmap: Bitmap, imagePath: String): Bitmap {
          val ei = ExifInterface(File(imagePath).absolutePath)
  
          return when (ei.getAttributeInt(
              ExifInterface.TAG_ORIENTATION,
              ExifInterface.ORIENTATION_NORMAL
          )) {
              ExifInterface.ORIENTATION_ROTATE_90 -&gt; rotate(bitmap, 90L.toFloat())
  
              ExifInterface.ORIENTATION_ROTATE_180 -&gt; rotate(bitmap, 180L.toFloat())
  
              ExifInterface.ORIENTATION_ROTATE_270 -&gt; rotate(bitmap, 270.toFloat())
  
              else -&gt; bitmap
          }
      }
  </code></pre>
  
  <p>The value of imagePath is </p>
  
  <pre><code>imagePath = "/storage/emulated/0/DCIM/Camera/IMG_20200319_211738.jpg"
  </code></pre>
  
  <p>However i get an exception in the ExifInterface(File(imagePath).absolutePath) line..!</p>
  
  <pre><code>Method threw 'java.io.FileNotFoundException' exception.
  android.system.ErrnoException: open failed: EACCES (Permission denied)
  </code></pre>
  
  <p>What am i doing wrong..?</p>