cats-oss / android-gpuimage

Android filters based on OpenGL (idea from GPUImage for iOS)
9k stars 2.27k forks source link

Crash when lib trying to get orientation #523

Closed rpavliuk closed 3 years ago

rpavliuk commented 3 years ago

I'm getting an exception when calling the setImage(uri) method. This is the exception:

android.database.CursorIndexOutOfBoundsException: Requested column: 0, # of columns: 0

Uri was received using default MediaStore.ACTION_IMAGE_CAPTURE with my locally created uri. I'm using this uri in other parts of my app and everything works fine.

I found out that this exception thrown when lib is trying to get an orientation in LoadImageUriTask. The cursor.getCount return 1, but cursor.getColumnCount return 0. That's why int orientation = cursor.getInt(0); throw an exception.

NOTE: When I'm using uri from Intent.ACTION_GET_CONTENT everything works fine

Any ideas how to fix this?

rpavliuk commented 3 years ago

Was my fault