2

I have downloaded the google vision api from https://github.com/googlesamples/ios-vision. And I tried Barcode detector example, When I try to scan a linear and 2D barcodes, the scanned area(purple shape) shows in wrong location on preview layer.

Note: This issue only occurs when I hold the device horizontally at the top of barcode.

Herewith I have attached the screenshot which reflects this issue.

Screenshot

Thank you!

Natarajan
  • 3,241
  • 3
  • 17
  • 34

1 Answers1

0

We might need more details about how the framework you mentioned handles orientations. But 2 possible solutions I can think of are:

1) If your project only supports portrait mode, clearly specify it in the project settings. This often solves the orientation issues. (I had a similar one when using OpenCV's camera implementation)

enter image description here

2) If your project does support different orientations, you might have to handle orientations yourself for that specific view controller, something like this:

What is the "right" way to handle orientation changes in iOS 8?

Pochi
  • 13,391
  • 3
  • 64
  • 104