Kris
Kris

Reputation: 921

zxing barcode is not decoding in portrait mode

i am using the zxing src and resource for my android application. enter image description here

it is reading QR code but not the barcode in portrait mode but it is working fine in landscape mode . what will be the problem .. anybody have any idea.

the original zxing scanning mode is in landscape but my requirement is in portrait mode so i changed the landscape design in to portrait.

<activity android:name="com.google.zxing.client.android.CaptureActivity"  android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">

above given is my manifest content.

Upvotes: 0

Views: 1984

Answers (3)

MichaelP
MichaelP

Reputation: 2781

Because almost camera driver return data in landscape view, so you have to rotate data. but data return from camera driver is YUV , you have to convert to RGB and then rotate it. this is really expensive operation.

Regards,

Upvotes: 0

Franklin Hirata
Franklin Hirata

Reputation: 288

Guy, in Portrait you wont read a code.

for example: In 2to5codes, you have 640px in horizontal, it means that you want 640px no less..

You should put

android:screenOrientation="landscape"

in Manifest.xml

ok?!

regards!!

Upvotes: 0

Sean Owen
Sean Owen

Reputation: 66886

I'm a developer of Barcode Scanner. Yes, it takes a lot more than this to make it scan in portrait mode. You have to "rotate" the image data, and account for the orientation of the device, its default orientation, and its sensor's orientation.

Barcode Scanner+ scans in portrait mode, and you can integrate with it via Intent in exactly the same way that you integrate with Barcode Scanner. (However it's a for-pay app.)

Upvotes: 1

Related Questions