Skip to content

Commit

Permalink
Fix Image rotate on Android 10+
Browse files Browse the repository at this point in the history
  • Loading branch information
MayankLogiciel authored Feb 18, 2021
1 parent bb55c42 commit b4e3ee0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/android/Library/src/ImageFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,17 @@ protected Bitmap doInBackground(Integer... params) {
} else {
if (rotate != 0) {
Matrix matrix = new Matrix();
matrix.setRotate(rotate);
/**
* Fixed by Tajinder on 18 Feb, 2021
* https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/227
* To fix image picker rotation issue on Android 10+, we don't want to
* execute following line. If we remove this line completely,
* this will cause then similar issue on Android 8 and Android 9
*/
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
matrix.setRotate(rotate);
}

thumb = Bitmap.createBitmap(thumb, 0, 0, thumb.getWidth(), thumb.getHeight(), matrix, true);
}
return thumb;
Expand Down

0 comments on commit b4e3ee0

Please sign in to comment.