Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zxing horizontal default orientation (Unity3D) #25

Closed
jacqueslelezard opened this issue Jun 15, 2017 · 2 comments
Closed

Zxing horizontal default orientation (Unity3D) #25

jacqueslelezard opened this issue Jun 15, 2017 · 2 comments

Comments

@jacqueslelezard
Copy link

jacqueslelezard commented Jun 15, 2017

Hi,
I'm using zxing on Unity3D and I noticed the default orientation is vertical. For my use case I need to scan horizontally but I can't find how to rotate the default scan orientation. For now I can make it work using both AutoRotate = true and TryHarder = true but it slow down the process (since each image is processed in different orientations).
Any idea of how to do that? Thanks.

@micjahn
Copy link
Owner

micjahn commented Jun 18, 2017

I would close that issue because of the answer of stackoverflow:
https://stackoverflow.com/questions/44564492/zxing-change-default-orientation-to-horizontal/44614704#44614704

I finally found the problem. By default the screen on mobile has a 90 rotation when using the portrait mode. Using rotateCounterClockwise rotate by 90 again so in none of these configuration I could read an horizontal barcode. The solution I found is to use rotateCounterClockwise 3 time: 90(default)+3*90 = 0!

One hint: I think it would be better you take a look at the source of rotateCounterClockwise and write a method rotateClockwise which you only have to call once.

@micjahn micjahn closed this as completed Jun 18, 2017
@jacqueslelezard
Copy link
Author

@micjahn Yes you can close it. Also I'll try to submit a PR with this new method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants