Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squashed preview image #96

Open
dazziola opened this issue Sep 3, 2015 · 21 comments
Open

Squashed preview image #96

dazziola opened this issue Sep 3, 2015 · 21 comments

Comments

@dazziola
Copy link

dazziola commented Sep 3, 2015

screenshot_2015-09-03-21-57-53

Is there anyway to get the ratio of the preview (above) to mimic that of the captured image (below)?

screenshot_2015-09-03-21-58-00

The ratio is different across both preview and captured image which makes it difficult to use this effectively. I've tried to mess around with the Java code, but to no avail. Any help?

@ChristopheBoucaut
Copy link
Contributor

Do you have the problem with the plugin without to change the code ? What is the device used ? I had this problem before but I fixed it and after I tested on Nexus 5, Samsung s3 mini, Samsung s4, LG G3, and some other devices.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

Hi Christophe, yes it is like this without changing any code. I have a One Plus One which is a 5.46 in (139 mm) 1920x1080 screen. It's quite large so maybe it has something to do with that?

@ChristopheBoucaut
Copy link
Contributor

Maybe ... So you use cyanogen with a One Plus One ? I never try the plugin on cyanogen, maybe a case particular. I try the plugin on cyanogen and I check.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

Yes, it's using CM. I have access to a few different devices that I could deploy it to, so I will verify the bug on a Moto G (2014) which runs stock Android and see if the same bug applies. Thanks for the help Christophe!

@ChristopheBoucaut
Copy link
Contributor

I tested on cyanogen and I don't have the bug. I rebuild an application and I will test without an overlay image. Maybe a new bug when the plugin doesn't receive an overlay image.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

Weird. How large is the screen you tested on? It's not just my build, I've created a few different apps and get the same result. The only difference I can think of (but it shouldn't matter) is I am using Ionic (which is built on Cordova)? Everything else works perfectly, so I can't see why Ionic would interfere with the plugin's layout or Java code.

@ChristopheBoucaut
Copy link
Contributor

I tested on Nexus 5 (1920x1080) and I don't have the bug :/

screenshot_2015-09-04-10-44-28
screenshot_2015-09-04-10-44-35

Can you try this apk : https://drive.google.com/file/d/0B4pG0sbdp0DCMHFlSElmSlZHMXM/view?usp=sharing.

It is my application to test the plugin. Press on an image or on the button "empty" to start the plugin.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

Just tested it and I get the same problems :/.

screenshot_2015-09-04-09-58-32
screenshot_2015-09-04-09-58-40

This is odd, I'd imagine I am the only one experiencing it if no one else has raised a bug in the past.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

Just for reference, it happens in landscape too.

screenshot_2015-09-04-10-03-18
screenshot_2015-09-04-10-03-25

@ChristopheBoucaut
Copy link
Contributor

Can you try this apk : https://drive.google.com/file/d/0B4pG0sbdp0DCT3hCSG00S1dsc0U/view?usp=sharing

and execute this command adb logcat -s "customCamera" in your bash to see logs. When you start the camera, I list camera resolutions found and the resolution used.

In my case, i get this:

D/customCamera(10848): 1920x1080
D/customCamera(10848): 1600x1200
D/customCamera(10848): 1280x960
D/customCamera(10848): 1280x768
D/customCamera(10848): 1280x720
D/customCamera(10848): 1024x768
D/customCamera(10848): 800x600
D/customCamera(10848): 800x480
D/customCamera(10848): 720x480
D/customCamera(10848): 640x480
D/customCamera(10848): 352x288
D/customCamera(10848): 320x240
D/customCamera(10848): 176x144
D/customCamera(10848): Resolution used: 1600x1200

because my screen has a 1920x1080 resolution but with the buttons bar (back, home, list tasks), i loose of the space so I must use a small resolution.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

09-04 11:21:38.602: D/customCamera(6210): 1920x1080
09-04 11:21:38.602: D/customCamera(6210): 1440x1080
09-04 11:21:38.602: D/customCamera(6210): 1280x960
09-04 11:21:38.602: D/customCamera(6210): 1280x720
09-04 11:21:38.602: D/customCamera(6210): 768x432
09-04 11:21:38.602: D/customCamera(6210): 720x480
09-04 11:21:38.602: D/customCamera(6210): 640x480
09-04 11:21:38.602: D/customCamera(6210): 576x432
09-04 11:21:38.602: D/customCamera(6210): 384x288
09-04 11:21:38.602: D/customCamera(6210): 320x240
09-04 11:21:38.602: D/customCamera(6210): Aspect tolerance not used
09-04 11:21:38.602: D/customCamera(6210): Resolution used: 1920x1080
09-04 11:21:38.609: D/QCameraParameters(240): Requested preview size 1920 x 1080

So mine is using the larger screen size. Have you tested it at this resolution before? I have the on screen buttons too. I still experience the "squashed effect" even with on-screen buttons disabled.

@ChristopheBoucaut
Copy link
Contributor

I don't test this resolution because my code choose always 1600x1200.

But I think the bug is here. I will search on stackoverflow the solution used to see if I missed something.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

That is understandable. Might it be to do with this?

09-04 11:21:38.602: D/customCamera(6210): Aspect tolerance not used

It seems as though I get different resolutions too compared to your more standard resolutions.

@ChristopheBoucaut
Copy link
Contributor

This message is bad ><. I added it just to see if the plugin uses the first or second if in the method to determine the resolution used. In my tests, the plugin has never used the second if but in your case, it used it... so I think the problem is here because I have never test this case.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

No worries Christophe, I'll certainly try to fix it if I can, but like I said, I'm not too great with Java and developing plugins! If you have any ideas of how to fix, let me know and I can try implement the changes required.

@ChristopheBoucaut
Copy link
Contributor

For me, it is the getOptimalPreviewSize method which got a problem or maybe the width and the height used to call this method in CameraActivity. For the method, I use the response on stackoverflow.

If you fix the bug, you are my hero ^^. This problem blocked me for 2 weeks and I believed that I had fixed it ... :'(

Else, I will search the next week to better understand the solution on stackoverflow.

@dazziola
Copy link
Author

dazziola commented Sep 4, 2015

No problem man, it's the only thing holding me back, the rest of the plugin is great! Looking forward to resolving this soon.

@ChristopheBoucaut
Copy link
Contributor

Hi @dazziola.

I have tried with a quick fix. I don't understand really the fix (I found it on stackoverflow). Nothing change for me, can you test this apk ? If the bug is fixed, I will try to include the fix properly (I'm not very confident but maybe with little luck ...). Else, I will search an another solution :).

APK : https://drive.google.com/file/d/0B4pG0sbdp0DCSDVScWwwRHR1dzQ/view?usp=sharing

@ChristopheBoucaut
Copy link
Contributor

Note: This fix doesn't work with all orientations. But if the bug is fixed in one orientation, I will adapt it for all orientations.

@dazziola
Copy link
Author

dazziola commented Oct 5, 2015

Hi Christophe. Apologies for the late reply - busy with work! Will check this out tonight and let you know it is. Thanks!

@ChristopheBoucaut
Copy link
Contributor

Okay :) No problem, I'm busy also so I can't work on the plugin before 2 weeks and only for one day. So you can take your time to test ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants