camera-preview icon indicating copy to clipboard operation
camera-preview copied to clipboard

Bugfix/93 preview not resized and displayed correctly when orientation changes

Open ryaa opened this issue 3 years ago • 14 comments

ryaa avatar Jul 20 '22 16:07 ryaa

We have the same issue on ios i think @ryaa did you tried ?

riderx avatar Aug 03 '22 14:08 riderx

We have the same issue on ios i think @ryaa did you tried ?

This should be fixed by this PR https://github.com/capacitor-community/camera-preview/pull/235. Please also see more details here https://github.com/capacitor-community/camera-preview/issues/232

ryaa avatar Aug 04 '22 09:08 ryaa

@ryaa i did merge your both PR in this repo and published it : https://github.com/Cap-go/camera-preview/tree/main And this is still failing, when rotate the camera view take half the screen on ios

riderx avatar Aug 05 '22 11:08 riderx

@ryaa i did merge your both PR in this repo and published it : https://github.com/Cap-go/camera-preview/tree/main And this is still failing, when rotate the camera view take half the screen on ios

@riderx, can you please try to install from my fork npm install ryaa/camera-preview#chore/my-latest-fixes-as-of-21-july-2022 It includes fixes for iOS (https://github.com/capacitor-community/camera-preview/issues/232) and Android (https://github.com/capacitor-community/camera-preview/issues/93) and other people tested and reported that everything seems to be working fine.

ryaa avatar Aug 12 '22 14:08 ryaa

@ryaa after second round of testing I can see an improvement. but still not as expected. The video doesn't rotate, then if I look down with the phone and up again it rotates. With these settings: CleanShot 2022-08-12 at 16 28 29@2x

https://drive.google.com/file/d/1awylwmhwq5oDWvtA8LNpcXLInbjLMmLC/view?usp=sharing

riderx avatar Aug 12 '22 15:08 riderx

https://drive.google.com/file/d/1awylwmhwq5oDWvtA8LNpcXLInbjLMmLC/view?usp=sharing

interesting. as I understand, the problem is on an Android device, right? I will try to double check to see if I can reproduce this problem. Right now, it seems to be working ok on my end.

ryaa avatar Aug 14 '22 03:08 ryaa

@ryaa nope that on IOS

riderx avatar Aug 14 '22 08:08 riderx

@ryaa nope that on IOS

This PR is for the fix for android and not iOS, so this is not relevant. Please note that the fix for iOS has already been merged to master and released - see https://github.com/capacitor-community/camera-preview/releases/tag/v3.1.1

ryaa avatar Aug 14 '22 11:08 ryaa

@ryaa the title of the fix for iOS is "fixed the problem when photos taken in the landscape orientation are off" which is not my issue. The issue I have is "preview not resized and displayed correctly when orientation changes" so that why I posted here. I agree the original issue is connected to Android, but not the PR, which is the one i found. Sorry for the misunderstanding

riderx avatar Aug 14 '22 12:08 riderx

@ryaa the title of the fix for iOS is "fixed the problem when photos taken in the landscape orientation are off" which is not my issue. The issue I have is "preview not resized and displayed correctly when orientation changes" so that why I posted here. I agree the original issue is connected to Android, but not the PR, which is the one i found. Sorry for the misunderstanding

ah.. got it... question - are you having the problem with the plugin installed from my branch (as I indicated above)? or is this the plugin installed from your branch?

ryaa avatar Aug 14 '22 12:08 ryaa

@ryaa i tried with both and the behavior is the same, who seems normal since my branch is ISO as yours. ^^ While reading the code i don't see any change for the rotation issue in your commit for IOS, so that seems normal to me.

riderx avatar Aug 14 '22 13:08 riderx

@ryaa i tried with both and the behavior is the same, who seems normal since my branch is ISO as yours. ^^ While reading the code i don't see any change for the rotation issue in your commit for IOS, so that seems normal to me.

Here is the change for iOS which fixes the rotation issue https://github.com/capacitor-community/camera-preview/pull/235/files It should be there, in the plugin source code

ryaa avatar Aug 14 '22 13:08 ryaa

@ryaa i have seen that change, for me this is the fix for "fixed the problem when photos taken in the landscape orientation are off" , but you mean that also fix when you rotate the camera that rotate the preview?

riderx avatar Aug 14 '22 13:08 riderx

@pbowyer when you have time to check that one, it seems important for android too :)

riderx avatar Aug 16 '22 16:08 riderx

@pbowyer if you need anything on this please ask :) I tried the fix and it work well on my side, for now i use the fork but i would love to get back on the main project for my company :)

riderx avatar Aug 29 '22 12:08 riderx

Thanks for checking these @riderx I will merge and make a new release 👍

Re "@pbowyer when you have time to check that one, it seems important for android too :)" -- which one do you mean by "that one"?

pbowyer avatar Aug 29 '22 13:08 pbowyer

thanks !

App MVP builder at Forgr https://forgr.ee/ Podcast host at INDIE MAKERS https://indiemakers.fr Maker of Captime https://captime.app Crossfit timer app Creator of Capgo https://capgo.app/ Capacitor OTA system

On August 29, 2022, Martin DONADIEU @.***> wrote:

Merged #238 <https://github.com/capacitor-community/camera- preview/pull/238> into master.

— Reply to this email directly, view it on GitHub <https://github.com/capacitor-community/camera-preview/pull/238#event- 7278504235>, or unsubscribe <https://github.com/notifications/unsubscribe- auth/AA7FGLZ3PIIHWFTLLHBOXZDV3SZHDANCNFSM54EL3XZQ>. You are receiving this because you were mentioned.Message ID: <capacitor-community/camera- @.***>

riderx avatar Aug 29 '22 13:08 riderx