bug: Rotating from portrait to landscape breaks scanner on ipad
Plugin(s)
- [X] Barcode Scanning
- [ ] Face Detection
- [ ] Face Mesh Detection
- [ ] Selfie Segmentation
- [ ] Translation
Version
6.1.0
Platform(s)
- [ ] Android
- [X] iOS
- [ ] Web
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
// Broken Landscape Mode after rotating
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
- [X] I have read and followed the bug report guidelines.
- [X] I have attached links to possibly related issues and discussions.
- [X] I understand that incomplete issues (e.g. without reproduction) are closed.
Unfortunately, I don't have access to an iPad 10. Feel free to create a PR.
are we progressing in this?
We found a semi good workaround. We listen to the screen rotate event and restart the scanner manually.
Hi @robingenz we are also facing the same issue in ipad devices, we tried workaround but that is causing some camera glitchi, it is not working as expected. please find the below workaround code.
setTimeout(() => {
ScreenOrientation.addListener('screenOrientationChange', (res: ScreenOrientation) => {
this.ngZone.run(() => {
this.screenOrientationTypeChange = res?.type;
if (this.screenOrientationTypeChange === 'landscape-primary' ||
this.screenOrientationTypeChange === 'landscape-secondary' ){
console.log('start scanner');
this.startScanner().catch(() => {});
}
});
});
}, 100);
Is there any plan to fix this issue for upcoming releases?
This is fixed in the latest version, see https://github.com/capawesome-team/capacitor-mlkit/commit/dd12ea8b8f5906f0ab56f3c1672d09e5a48426bb.
Hi @robingenz i am not seeing these commit changes in latest 7.0.0 version for below change log
https://github.com/capawesome-team/capacitor-mlkit/commit/dd12ea8b8f5906f0ab56f3c1672d09e5a48426bb
i installed latest version and tested in fix, but unfortunately it is not working, same issue has been reproduced, please confirm me once.
Note: This fix is working in 7.0.0-next.3 version
Is there anything is missing in 7.0.0 version?
@anusha-kaparapu Yes, you're right. Something went wrong with the merge. I have created a new PR: #248. Thanks for letting me know!
Thanks for quick response @robingenz , when can we expect these changes in latest 7.0.0 version as we are moving to production soon. i have one more dought according to the document, the capacitor core should be 7, but we are only utilising 6 because of project requirements. We used the following command to force the package upgrade.
- npm install @capacitor-mlkit/[email protected] —force
- Will there be any problems pushing to app stores or will there be any issues with the packages I forced to update?
@anusha-kaparapu
when can we expect these changes in latest 7.0.0 version as we are moving to production soon.
We plan to publish a new release this week.
Will there be any problems pushing to app stores or will there be any issues with the packages I forced to update?
I can't answer that as I have never tested this combination.
Thanks @robingenz
Hi @robingenz we have upgraded to latest 7 version of barcode scanner and try to build an archive my app in xcode and try to export privacy report.
but still im getting below report
but i got below email from Apple store
inorder to cross verify I uninstalled barcode-scanner then my privacy report is empty(no issues). im confuse here, how to solve both issues please guide me on it
@robingenz when can we expect these commit changes https://github.com/capawesome-team/capacitor-mlkit/pull/248, as we are close to our production release.
@anusha-kaparapu We will publish the next release today.
Thanks @robingenz