WeScan icon indicating copy to clipboard operation
WeScan copied to clipboard

Camera View Orientation Bug?

Open ghost opened this issue 5 years ago • 14 comments

If i change the Orientation on the iPad (iOS 11) its rotating the Camera View. After its rotated the Axis in the Camera View are swapped. When i turn the iPad to the left the camera view moves the visible camera output to the bottom. Is this a bug or could u give me any advice to fix this behaviour? Its mentioned in #76 and #185 and it's still a problem or am i missing something?

ghost avatar Feb 11 '20 10:02 ghost

I am still seeing this bug as well (iPad Pro, iOS 13).

Regardless of whether an app is launched in landscape or portrait, the scanner opens in portrait.

bdjessup avatar Mar 09 '20 21:03 bdjessup

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Apr 09 '20 00:04 github-actions[bot]

Just bumping to add interest - Im of firm belief this is actually an issue at the iOS framework level, other libraries and scanning implementations have users reporting the same issue. I first discovered it using WeScan.

I experience the bug on an iPad Air iOS 12.4.8, there are other iOS devices not experiencing the bug.

Is there any insight into its remedy here?

Pellagius avatar Aug 21 '20 05:08 Pellagius

Is there any insight into its remedy here?

We have not yet found the time to dive in. In those other projects, have you found an example with a fix too? That could help speed up fixing this.

AvdLee avatar Aug 21 '20 06:08 AvdLee

My customers are seeing this bug as well on all iPad devices. Any way to make this a priority fix?

ethanwa avatar Mar 22 '21 21:03 ethanwa

@ethanwa unfortunately, we're not actively developing WeScan at this moment. We're happy to receive any contributions and review accordingly.

AvdLee avatar Mar 23 '21 09:03 AvdLee

Has anyone been able to fix this yet? My app only works in landscape and the camera pops up in portrait orientation.

willm132 avatar May 18 '21 15:05 willm132

@AvdLee Would just changing this be able to fix our issues?

override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {        
    return .portrait   
// can we change this to .landscape to change the orientation? 
// Or is there more to this like having to change camera properties?
}

willm132 avatar May 25 '21 20:05 willm132

@AvdLee Would just changing this be able to fix our issues?

I've not tried that out but to me, that would disable landscape completely, wouldn't it?

AvdLee avatar May 26 '21 06:05 AvdLee

@AvdLee I am not sure. Is anyone able to take a look at a fix for this?

willm132 avatar May 27 '21 19:05 willm132

@AvdLee I am not sure. Is anyone able to take a look at a fix for this?

Currently, WeScan is not on our list of priorities. We're open for contributions and aim to review PRs within 1 working day. So feel free to apply a fix 🙂

AvdLee avatar May 28 '21 07:05 AvdLee

I also ran into this.

So I tried to dig into it, and it's a bit of a rabbit hole. Just returning .all from supportedInterfaceOrientations doesn't do much. I then was able to correct the video preview in CameraScannerViewController by updating the orientation in viewDidLayoutSubviews, which fixed the video, but the rectangle overlays were still wrong. To fix that you'd have to recalculate the quad transforms. Once the preview is fixed, you'd then have to update the capture code to ensure the actual images are properly processed in the right orientation.

The whole package seems to be designed for portrait mode, so there is no isolated surgical fix.

I looked around for other example code, and all examples I could find, including from Apple, do not handle landscape mode properly for any of their VN examples with previews.

The last comment here was from 2 years ago, so if anyone else solved this in the interim I'm interested in what they did.

samkass avatar Dec 03 '23 15:12 samkass