capawesome-team / capacitor-mlkit

⚡️ ML Kit plugins for Capacitor. Supports Android and iOS.
https://capawesome.io/plugins/mlkit/
Apache License 2.0
139 stars 38 forks source link

bug: Rotating from portrait to landscape breaks scanner on ipad #168

Open mbrunneritlabs opened 1 month ago

mbrunneritlabs commented 1 month ago

Plugin(s)

Version

6.1.0

Platform(s)

Current behavior

On most devices when opening the barcode scanner in portrait mode and then turning to landscape mode the picture in the scanner window turns correctly.

On Ipad10 when turning the barcode scanner window from portrait to landscape the picture doesnt turn and the window is cut on the right side.

So our app itself and the overlay turns correctly to landscape mode but the scanner stays in portrait mode.

// Portrait Mode

Image

// Broken Landscape Mode after rotating

Image

Interesting:

Starting the scanner in landscape mode works correctly. The issue only occurs when turning the scanner from portrait to landscape while running and only on our ipad test device.

Expected behavior

When turning to landscape mode the scanner turns correctly on ipad.

Reproduction

The bug lies withing the scanner itself

Steps to reproduce

Run BarcodeScanner.startScan on Ipad 10 Turn from Portrait Mode to Landscape -> The picture from camera is rotated incorrectly and black bar occurs.

Other information

No response

Capacitor doctor

I currently cannot run this command but can provide the next days.

Before submitting

robingenz commented 1 month ago

Unfortunately, I don't have access to an iPad 10. Feel free to create a PR.

orl99 commented 3 weeks ago

are we progressing in this?

mbrunneritlabs commented 2 weeks ago

We found a semi good workaround. We listen to the screen rotate event and restart the scanner manually.