  import androidx.exifinterface.media.ExifInterface;
  import android.text.TextUtils;
 +import android.net.Uri;
++import android.util.Log;
  
  import java.io.File;
  import java.io.FileInputStream;
-@@ -96,7 +100,8 @@ final class MediaLibraryUtils {
++import java.io.FileNotFoundException;
+ import java.io.FileOutputStream;
+ import java.io.IOException;
+ import java.nio.channels.FileChannel;
+@@ -96,7 +102,8 @@ final class MediaLibraryUtils {
    }
  
    static void queryAssetInfo(Context context, final String selection, final String[] selectionArgs, boolean fullInfo, Promise promise) {

         EXTERNAL_CONTENT,
         ASSET_PROJECTION,
         selection,
@@ -109,7 +114,7 @@ final class MediaLibraryUtils {
         if (asset.getCount() == 1) {
           asset.moveToFirst();
           ArrayList<Bundle> array = new ArrayList<>();

+    int height = cursor.getInt(heightIndex);
+    int orientation = cursor.getInt(orientationIndex);
+
+    // If the image doesn't have the required information, we can get them from Bitmap.Options
+    if (mediaType == Files.FileColumns.MEDIA_TYPE_IMAGE && (width <= 0 || height <= 0)) {
       BitmapFactory.Options options = new BitmapFactory.Options();
       options.inJustDecodeBounds = true;
+      BitmapFactory.decodeFile(uri, options);
