rotateImage method
Implementation
Future rotateImage(int rotationVal) async {
try {
final fixedImageBytes = await FlutterImageCompress.compressWithList(
bytes,
rotate: rotationVal,
quality: 100,
keepExif: false,
autoCorrectionAngle: true,
format: CompressFormat.jpeg,
);
// invert height and width
int oldHeight = height;
height = width;
width = oldHeight;
bytes = fixedImageBytes;
} catch (e) {
debugPrint("failed to rotate: ${e.toString()}");
}
}