Code Monkey home page Code Monkey logo

squarecamera's People

Contributors

abdyer avatar boxme avatar bryant1410 avatar pavlospt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

squarecamera's Issues

Showing camera has problem

Hi,

I've used your library and everything is fine, thanks, but showing the camera section is the only problem which is exists. The camera section not showing or sometimes showing. How can I fix this important problem?

bug on moto g with android L

Hello,

I'm trying to use your library into my project but when I call CameraActivity Im getting this stack trace:

8-15 15:27:39.810 29470-29470/br.com.brosource.hstgbrasil E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: br.com.brosource.hstgbrasil, PID: 29470
java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.brosource.hstgbrasil/com.desmond.squarecamera.CameraActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2388)
at android.app.ActivityThread.access$800(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:124)
at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
at com.desmond.squarecamera.CameraActivity.onCreate(CameraActivity.java:18)
at android.app.Activity.performCreate(Activity.java:5953)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2388)
            at android.app.ActivityThread.access$800(ActivityThread.java:148)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5312)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)

Image Mirror

Is there a way for the preview to be mirrored ? Need to have this in place. Also can we change the camera preview to not be a square? I want to provide an option for the user to toggle between a square preview and a regular one.

Min SDK version

Hello, first of all thanks for sharing your lib! It would be possible to use it in lower android versions (api 7-9) or there are special features only working in api level 14?

Thanks!

Problem with adding camera.

Hi there,

I'm a total noob but it seems I have a problem with adding this module. When I run my app, it says that CameraActivity is not declared in my manifest and throws an error. Any help?

EDIT: I figured out how to include but now I get this error:


05-05 21:06:08.225  25802-25802/com.joinspur.spur E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.joinspur.spur, PID: 25802
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.setDisplayOrientation(int)' on a null object reference
            at com.desmond.squarecamera.CameraFragment.determineDisplayOrientation(CameraFragment.java:250)
            at com.desmond.squarecamera.CameraFragment.startCameraPreview(CameraFragment.java:184)
            at com.desmond.squarecamera.CameraFragment.surfaceCreated(CameraFragment.java:372)
            at android.view.SurfaceView.updateWindow(SurfaceView.java:580)
            at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:176)
            at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1970)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
            at android.view.Choreographer.doCallbacks(Choreographer.java:580)
            at android.view.Choreographer.doFrame(Choreographer.java:550)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
            at android.os.Handler.handleCallback(Handler.java:739)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5254)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

black screen until I change flash mode

I run camera and see black square instead of camera output. When I click on flash mode then camera work fine.
I use xperia Z1 compact phone with 5.0 on the board.

Integration problem

Hello, I'm trying to integrate this into my project.
Do I use it as a Library reference ?

Could seem to get it to run, it says "Class not found usign the boot loader"

Any help, please.

Having problems using a tablet

I know that all the sizes are adjusted according to the device, however when im using a large 9.7" tablet there's no buttons, it only displays an image view of the camera, with no button/s to take a picture with. Any way around this?

takePicture failed / autoFocus failed

Hi, im looking through my crashlogs of the app today, and some users are experiencing weird errors:

java.lang.RuntimeException: takePicture failed
       at android.hardware.Camera.native_takePicture(Camera.java)
       at android.hardware.Camera.takePicture(Camera.java:1484)
       at com.keepinmind.lifeshot.ui.CameraFragment.takePicture()
       at com.keepinmind.lifeshot.ui.CameraFragment.access$900()
       at com.keepinmind.lifeshot.ui.CameraFragment$4.onClick()

See: http://stackoverflow.com/questions/21723557/java-lang-runtimeexception-takepicture-failed

And the following:

java.lang.RuntimeException: autoFocus failed
       at android.hardware.Camera.native_autoFocus(Camera.java)
       at android.hardware.Camera.autoFocus(Camera.java:1299)
       at com.keepinmind.lifeshot.widget.SquareCameraPreview.handleFocus()
       at com.keepinmind.lifeshot.widget.SquareCameraPreview.onTouchEvent()

See: http://stackoverflow.com/questions/8820702/autofocus-throwing-exception
See: dm77/barcodescanner@15a64d0

Adding a focus rectangle on tap to focus

Can anyone guide me on how to achieve a rectangle drawn over focus area anytime a specific area is touched? I cant seem to find any good tutorials on this feature...
In SquareCameraPreview. we already have the focus bounds in the arraylist mFocusAreas so how do we go about adding the rectangle?

Thanks

app passed NULL surface

Hi

Thanks for this great library. Its been working fine on my device but there is something on the log that is bugging me. It says:

03-02 20:18:30.962 18221-18221/com.desmond.demo D/Camera: app passed NULL surface
03-02 20:18:31.051 18221-18221/com.desmond.demo W/CameraBase: An error occurred while connecting to camera: 0
03-02 20:18:31.051 18221-18221/com.desmond.demo D/CameraFragment: Can't open camera with id 0
03-02 20:18:31.051 18221-18221/com.desmond.demo W/System.err: java.lang.RuntimeException: Fail to connect to camera service
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.hardware.Camera.(Camera.java:497)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.hardware.Camera.open(Camera.java:342)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at com.desmond.squarecamera.CameraFragment.getCamera(CameraFragment.java:215)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at com.desmond.squarecamera.CameraFragment.surfaceCreated(CameraFragment.java:458)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.view.SurfaceView.updateWindow(SurfaceView.java:580)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:176)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1970)
03-02 20:18:31.052 18221-18221/com.desmond.demo W/System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:580)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.view.Choreographer.doFrame(Choreographer.java:550)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.os.Handler.handleCallback(Handler.java:739)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.os.Looper.loop(Looper.java:135)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5254)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at java.lang.reflect.Method.invoke(Native Method)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at java.lang.reflect.Method.invoke(Method.java:372)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
03-02 20:18:31.053 18221-18221/com.desmond.demo W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
03-02 20:34:50.202 18221-18231/com.desmond.demo I/art: Debugger is no longer active

Do you know what might be causing the problem? I did not change anything from the demo file and this is what I get from it.

How to customize camera settings

I basically copied the files to my project to see if I could customize some of the settings, mainly UI and save settings. Everything that has to do with the camera is the same, but, whenever I try to run it, the camera looks squished and when I take the picture, the result picture looks good, but it crops off top and bottom a little.

Detecting swipe gestures on CustomCameraPreview/SurfaceView

I am trying to detecting the left/right gestures on CameraPreview view. Since this view handles the zoom in/out feature which is great but at the same time, I want to detect that user swiped on the cameraPreview as well.

Any help is appreciated.

Thanks

Samsung Galaxy preview is blur. (fix)

i have pulled the library and tested out the demo apk, however i had an issue with the preview that is blur, due to the fix that is very simple, i choose not to do pull request. i hope you don't mind.
the fix is to change setupCamera() in startCameraPreview() method to after the try block . in CameraFragment class.

Question about integration.

Hi, I want to open another fragment after taking the picture. I've tried many, many ways and I can't do it yet. Can you help me with it? Also, if I try to do anything on the onActivityResult switch-case, I can't because it never gets to enter to the switch code.

Thanks!

Adding to build.gradle

I'm currently using compile 'com.github.boxme:SquareCamera:f135f2a99f'

Is there a better way? Noob here.

No Callback at all?

Question: Is this a dummy project / does it need to be extended to work, because I get no callbacks.

So, describing the problem:

I tried to use this inside a project of mine and I get no callbacks at all.
Logcat / Console puts out this, when I click the checkmark after taking a picture:

V/FA: Activity paused, time: 4408130
V/FA: Activity resumed, time: 4408198

A callback is not happening at all, I log every call of onActivityResult in my Activity.
Then I looked inside the code of the EditSavePhotoFragment and found this snippet

view.findViewById(R.id.save_photo).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
savePicture();
}
});

This should save the picture, but the savePicture method is just a dummy for requesting the permissions, see here:

private void savePicture() {
requestForPermission();
}
private void requestForPermission() {
RuntimePermissionActivity.startActivity(EditSavePhotoFragment.this,
REQUEST_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE);
}

So where exactly should the callback happen. Please give me a hint on how to fix this. Any help is very much appreciated!

Ability to capture multiple photos

It would be great if the ability to capture multiple photos without invoking the camera again and again, will be added in a future release. Thank you!

setParameters failed when tap focus

I want change the focus area, after I change the value of FOCUS_MAX_BOUND in SquareCameraPreview from 1000 to 1200, then catch the Exception, how to solve it?
(Because the foucs event for large device i.e. 1200x1800, the area is not enough)

Documentation needed

Hi, I know that making documentation, for coders is not funny.
But I need to know on which phones and android versions this library has been tested!

setParameters failed

Some devices are experiencing the following error. Do you have any idea what this could be?

60%: ASUS T00I
40%: ASUS T00J
5%: Samsung A700F
3%: Lenovo Lifetab P981X

I know that the ASUS devices has no flash. But before setting the flashmode its checked...

Unusable stacktrace from Crashlytics:

Fatal Exception: java.lang.RuntimeException: setParameters failed
       at android.hardware.Camera.native_setParameters(Camera.java)
       at android.hardware.Camera.setParameters(Camera.java:1707)
       at com.keepinmind.lifeshot.ui.CameraFragment.setupCamera(Unknown Source)
       at com.keepinmind.lifeshot.ui.CameraFragment.getCamera(Unknown Source)
       at com.keepinmind.lifeshot.ui.CameraFragment.surfaceCreated(Unknown Source)
       at android.view.SurfaceView.updateWindow(SurfaceView.java:580)
       at android.view.SurfaceView.access$000(SurfaceView.java:90)
       at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183)
       at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1917)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1043)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:771)
       at android.view.Choreographer.doCallbacks(Choreographer.java:574)
       at android.view.Choreographer.doFrame(Choreographer.java:544)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:757)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:149)
       at android.app.ActivityThread.main(ActivityThread.java:5257)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
       at dalvik.system.NativeStart.main(NativeStart.java)

Starting the main activity takes too long in latest version

Hi,

I've found in the latest version, starting the main activity takes too long and makes my UI to freeze! There is no such thing in early versions. I don't have enough time to check what's the reason right now. Please give some minutes to fix this. Thank you,

Another thing, Please provide a way to specify the saved path. I customized your library for now, just because of this.

NPE CameraFragment take picture function when attempting to take picture.

Just got this crash log with an app I have SquareCamera installed:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.takePicture(android.hardware.Camera$ShutterCallback, android.hardware.Camera$PictureCallback, android.hardware.Camera$PictureCallback, android.hardware.Camera$PictureCallback)' on a null object reference
       at com.desmond.squarecamera.CameraFragment.takePicture(CameraFragment.java:398)
       at com.desmond.squarecamera.CameraFragment.access$1000(CameraFragment.java:33)
       at com.desmond.squarecamera.CameraFragment$4.onClick(CameraFragment.java:167)
       at android.view.View.performClick(View.java:5254)
       at android.view.View$PerformClick.run(View.java:21179)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Happened when attempting to take picture.

Phone:
Samsung Galaxy S6, Lollipop v5.1.1

My code calling SquareCamera:
compile 'com.github.boxme:squarecamera:1.0.3'

Intent startCameraIntent = new Intent(getActivity(), CameraActivity.class);
startActivityForResult(startCameraIntent, CAMERA_REQUEST);

Image size

Hello,

Maybe I missed that, but how can I change the size of the picture?

Thanks,

Lionel

crash camera preview

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.setDisplayOrientation(int)' on a null object reference
at com.desmond.squarecamera.CameraFragment.determineDisplayOrientation(CameraFragment.java:325)
at com.desmond.squarecamera.CameraFragment.startCameraPreview(CameraFragment.java:241)
at com.desmond.squarecamera.CameraFragment.restartPreview(CameraFragment.java:234)
at com.desmond.squarecamera.CameraFragment.onResume(CameraFragment.java:434)
at android.support.v4.app.Fragment.performResume(Fragment.java:2020)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1107)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2056)
at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:196)
at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:505)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:494)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:174)
at android.app.Activity.performResume(Activity.java:6344)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3110)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3152)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

Theme problem

I'm getting this error when I try to build the project using this library:
Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@theme value=(@style/AppTheme) from AndroidManifest.xml:16:9-40
is also present at [com.github.boxme:squarecamera:1.1.0] AndroidManifest.xml:11:18-76 value=(@style/squarecamera__CameraFullScreenTheme).
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:11:5-57:19 to override.

use image without compress

Hi, i dont want to compress captured image. i just want to use original image. can you please help me with it?

Manifest merger failed / ActivityNotFoundException on CameraActivity

Hi,

I get

Error:Execution failed for task ':hospitalitix:processDebugManifest'.
Manifest merger failed : Attribute application@theme value=(@style/AppBaseTheme) from AndroidManifest.xml:17:9-44
is also present at [com.github.boxme:squarecamera:1.1.0] AndroidManifest.xml:11:18-76 value=(@style/squarecamera__CameraFullScreenTheme).
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:14:5-33:19 to override.

when trying to use your lib. If I override as suggested I get

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.assaabloyhospitality.hospitalitix/com.desmond.squarecamera.CameraActivity}; have you declared this activity in your AndroidManifest.xml?

when trying to start your activity via Intent. Not sure the problems are related though.

Is there a reason you have a theme set on application level? Since you only have one Activity, and it has a theme set, the application level theme is never used.

Br.
Jonas

Preview not squared on galaxy tab 3

This is how the preview looks like on Samsung galaxy tab 3:
bug
I did't check the code yet, someone have notice this issue before? The picture taken is squared and perfectly good, it's just a problem with the size of the preview.

Issues

Hey thanks for sharing!

Just tried it and i have a few observations.

The photo taken inside the square, is not the same as the photo saved. I think the bottom of the saved photo needs a bit of cropping.

If the phone goes into landscape mode the result picture looks kinda streched.

Front camera, try flipping the image. By default the image produced looks weird, you need to invert it

Save last flash mode

Now camera always starts with "auto" flash mode.
It is reasonable to save last user selection.

Where is the code that makes the preview area square?

This is not a bug issue. I'm just wondering where is the code that makes the preview area square? I debug for a while and no progress? Besides, in CameraFragment's determineBestSize method, why you make desire ratio to like this:
boolean isDesireRatio = (size.width / 4) == (size.height / 3);
Thank you.

Stretched Preview for 3:4 aspect ratio

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?

CameraActivity has leaked - After the image is captured

Thank you for a wonderful abstraction of Camera API. The Code is clean and I really like the minimal amount of code required to get this lib working.

However I am getting this error sometimes. It happens after the image is captured and ticking on the right icon (in fragment_edit_save_photo.xml), would look into this and let us know the cause.

Also If you could add this lib to gradle repo would be great.

E/ActivityThreadActivity com.desmond.squarecamera.CameraActivity has leaked ServiceConnection android.media.MediaScannerConnection@425737d0 that was originally bound here
    android.app.ServiceConnectionLeaked: Activity com.desmond.squarecamera.CameraActivity has leaked ServiceConnection android.media.MediaScannerConnection@425737d0 that was originally bound here
            at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:977)
            at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:871)
            at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1625)
            at android.app.ContextImpl.bindService(ContextImpl.java:1608)
            at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
            at android.media.MediaScannerConnection.connect(MediaScannerConnection.java:119)
            at android.media.MediaScannerConnection.scanFile(MediaScannerConnection.java:238)
            at com.desmond.squarecamera.ImageUtility.savePicture(ImageUtility.java:96)
            at com.desmond.squarecamera.EditSavePhotoFragment.savePicture(EditSavePhotoFragment.java:103)
            at com.desmond.squarecamera.EditSavePhotoFragment.access$000(EditSavePhotoFragment.java:21)
            at com.desmond.squarecamera.EditSavePhotoFragment$1.onClick(EditSavePhotoFragment.java:73)
            at android.view.View.performClick(View.java:4445)
            at android.view.View$PerformClick.run(View.java:18446)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5146)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
            at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
            at dalvik.system.NativeStart.main(Native Method)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.