Does the Unity version support other formats beside QR-Code? #429
-
Hello everyone, I'm currently playing around with the unity version of Zxing.net. It works straight out of the box with minimal configuration and it works like a charm.....but only for QR-Codes it seems? I've been debugging all night but haven't found any reason as to why. I used a barcode encoder website to test if the problem resides with only code-128 for example, but it seems that only QR-Codes are working, other 2D codes aren't working as well. Now, before I'm spending the next week debugging this issue, I'd first like to confirm that it's actually supported. I came across a similar Github issue on the java version where any other type besides QR-Code was disabled by default in the package lib. Just in case, the code is nothing more than:
I've tried to play around with the Can someone confirm if the question in the title is true, or is there something obvious that I'm missing? Edit 1: Example of barcode that I expect to be scannable: Edit 2: I still haven't figured out what causes this problem. I do downsize the image by 50% as recommended. See:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
ZXing.Net supports more than only QR codes. |
Beta Was this translation helpful? Give feedback.
-
My sincere apologies, the issue is not with ZXing but rather with the way that the AR foundation handles raw camera output. Apparently, when you access the camera on a mobile device the default camera rotation is landscape. So even if your phone is in portrait mode, the camera's raw image output is still in landscape. The AR foundation does not care for device rotation, however when your camera is in portrait mode it still shows it as portrait, while in the background your camera images are processed in landscape. This is a huge false positive understandably confusing for a lot of developers. To fix the issue you can rotate your Texture2D with this code:
@micjahn if people in the future come across the same problem you might want to redirect them to this topic. |
Beta Was this translation helpful? Give feedback.
My sincere apologies, the issue is not with ZXing but rather with the way that the AR foundation handles raw camera output. Apparently, when you access the camera on a mobile device the default camera rotation is landscape. So even if your phone is in portrait mode, the camera's raw image output is still in landscape. The AR foundation does not care for device rotation, however when your camera is in portrait mode it still shows it as portrait, while in the background your camera images are processed in landscape. This is a huge false positive understandably confusing for a lot of developers. To fix the issue you can rotate your Texture2D with this code: