Skip to content

Commit e08c847

Browse files
committed
use frame's orientation to get rotation degree
1 parent cb3039a commit e08c847

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ios/DBRFrameProcessorPlugin.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ public class DBRFrameProcessorPlugin: FrameProcessorPlugin {
4141

4242
var image = UIImage(cgImage: cgImage)
4343
var degree = 0.0;
44-
if UIDevice.current.orientation == UIDeviceOrientation.portrait {
44+
if frame.orientation == UIImage.Orientation.left {
4545
degree = 90.0;
46-
}else if UIDevice.current.orientation == UIDeviceOrientation.landscapeRight {
47-
degree = 270.0;
46+
}else if frame.orientation == UIImage.Orientation.down {
47+
degree = 180.0;
4848
}
4949
if degree != 0.0 {
5050
image = DBRFrameProcessorPlugin.rotate(image:image,degree:degree)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vision-camera-dynamsoft-barcode-reader",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"description": "React Native Vision Camera Frame Processor Plugin of Dynamsoft Barcode Reader",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)