Skip to content

Commit

Permalink
use frame's orientation to get rotation degree
Browse files Browse the repository at this point in the history
  • Loading branch information
xulihang committed Jul 12, 2024
1 parent 6e236a5 commit 2818b36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ios/DetectionFrameProcessorPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class DetectionFrameProcessorPlugin: FrameProcessorPlugin {
var returned_results: [Any] = []
var image = UIImage(cgImage: cgImage)
var degree = 0.0;
if UIDevice.current.orientation == UIDeviceOrientation.portrait {
if frame.orientation == UIImage.Orientation.left {
degree = 90.0;
}else if UIDevice.current.orientation == UIDeviceOrientation.landscapeRight {
degree = 270.0;
}else if frame.orientation == UIImage.Orientation.down {
degree = 180.0;
}

if degree != 0.0 {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vision-camera-dynamsoft-document-normalizer",
"version": "3.2.1",
"version": "3.2.2",
"description": "A React Native Vision Camera frame processor plugin for Dynamsoft Document Normalizer which can be used to create a document scanner.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit 2818b36

Please sign in to comment.