flutter_native_image
flutter_native_image copied to clipboard
bounds are outside of the dimensions of the source image
In my device google pixel 4 or some devices image is horizontal. You need check rotate and rotate bitmap with code below if don't want error
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
Log.d("EXIF", "Exif: " + orientation);
Matrix matrix = new Matrix();
float degrees = 0;
if (orientation == ExifInterface.ORIENTATION_ROTATE_90) {
matrix.postRotate(90);
}
else if (orientation == ExifInterface.ORIENTATION_ROTATE_180) {
matrix.postRotate(180);
}
else if (orientation == ExifInterface.ORIENTATION_ROTATE_270) {
matrix.postRotate(270);
}
Bitmap flipBitmap = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
bmp = Bitmap.createBitmap(flipBitmap, originX, originY, width, height);
Hope it helpful
It is possible to add this in the library ?