Open rohanmahale opened 8 years ago
Hey @philipgiuliani. Could you help me out? I am using the same preview class that is being used in the square camera lib. However in a samsung e5, the front camera preview is getting stretched. How do I make sure that the preview works on all devices without it getting stretched.
Hi. You are on the current version of the library, or? I remember some streching issues here: https://github.com/boxme/SquareCamera/issues/8 but they seem to be solved. I am not using this library directly, have modified a lot in my projects. If you want i can send you my code. In my project its working perfect on a S5 with front camera! https://play.google.com/store/apps/details?id=com.keepinmind.lifeshot
Yeah I just used the preview class from the library here. Could you please share your code? I have seen that it stretches in the front cam of a samsung e5(not sure if it stretches on s5)
Could you test if you get the problems in the lifeshot app? To reach the camera, just create a lifeshot (bottom right button, 2 times), set it to "Just now" and it should start. You will need a friend to do this. You can add me: "Philip Giuliani" (through the search).
The problem is I do not have access to that device. That person with the device sent me a screen shot and he is not available for most of the day.
Oh that's bad :( Im not sure if it works with my code. I modified a lot and it won't be compatible with the current version of the library.
I pasted everything about the processing, rotating ect. Try to update your ProcessImage Async task to be like this one. It will also speed-up the processing!
// Code removed
But isnt the relevant class in this case the Camera Preview Class(Surfaceview)? I'm not having issues with the actual image stretching I think. It is the camera preview which is appearing stretched on the e5.
In my UI I have a fixed panel at the bottom(some 100dp or 200 dp or so), and the camera preview fills the rest of the screen above it. This works on quite a few devices. The only complaint up until now was from the guy with the e5. The camera preview width and height is set to matchParent and is above the bottom controls panel.
Ah oh the camera preview... Than i understood it wrong. So you have fixed sizes? You will have to calculate the height of the covers, they are different for every device of course...
My cover size code: // Code removed
I have added the .requestLayout() because it wasnt working somewhere. I dont remember...
Nope... I mean my bottom controls bar is of a fixed size. The rest of the screen above it has to be the camera preview.
I have used your SurfaceView Class in my camera implementation. The 3:4 aspect ratio works great in most cases. However in some phones(samsung e5 for eg), the preview is getting stretched,is there a fix for this?