Giter Club home page Giter Club logo

fotoapparat's People

Contributors

alaeri avatar aliasadi avatar andrewcking avatar ansman avatar defer avatar diederikjh avatar diolor avatar dmitry-zaitsev avatar ezaquarii avatar friendoye avatar hagabaka avatar hegazy avatar hluhovskyi avatar ivan200 avatar johnnymartinovic avatar jpribble avatar knightcube avatar kphil avatar octohub avatar paulwoitaschek avatar pflammertsma avatar radoslavdodek avatar raenar4k avatar rafaeltoledo avatar saantiaguilera avatar sandib avatar simone-gasparini avatar wolf81 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  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

fotoapparat's Issues

Wiki needs a bit of improvement

The wiki page is a bit badly structured making the Rx example very incomplete.
I would suggest adding a page with a better example of its usage, the needed/possible import versions like compile 'io.fotoapparat.fotoapparat:adapter-rxjava2:1.0.2' and maybe start adding Kotlin examples.

Fatal Exception: io.fotoapparat.hardware.CameraException java.lang.RuntimeException: Fail to connect to camera service

Hi
One of our users is getting these crashes whilst trying to use the camera.
Phone model: HTC One mini 2
Android version: 4.4.2

Stack trace 1:
Fatal Exception: io.fotoapparat.hardware.CameraException: java.lang.RuntimeException: Fail to connect to camera service
at io.fotoapparat.hardware.v1.Camera1.open(Camera1.java:63)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:39)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:864)
Caused by java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.native_setup(Camera.java)
at android.hardware.Camera.(Camera.java:549)
at android.hardware.Camera.open(Camera.java:424)
at io.fotoapparat.hardware.v1.Camera1.open(Camera1.java:60)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:39)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:864)

Stack trace 2:
Fatal Exception: java.lang.NullPointerException
at io.fotoapparat.hardware.v1.Camera1.stopPreview(Camera1.java:123)
at io.fotoapparat.routine.StopCameraRoutine.run(StopCameraRoutine.java:18)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:864)

whenAvailable callback for saveToFile(FIle file)

Hey guys, is it possible to trigger a callback when saveToFile has finished execution? I've been trying to create a new PendingResult.Callback but can't seem to figure out the proper Callback type.

   PhotoResult photoResult = fotoapparat.takePicture();

    File f = new File(
            getActivity().getExternalFilesDir("photos"),
            "newImage.jpg"
    );

    PendingResult.Callback<?> callback = new PendingResult.Callback<Void>() {
        @Override
        public void onResult(Void v) {
            Log.d(TAG,"SAVE FILE CALLBACK");
        }
    };

    photoResult.saveToFile(f).whenAvailable(callback);

Toggle flash mode

Hey, is there any way to toggle the flash mode without using FotoapparatSwitcher?

question how to save photo as byte array

Hi, I want to know how to save photo captured as byte array directly.
In this sample code :
`private void takePicture() {
PhotoResult photoResult = fotoapparatSwitcher.getCurrentFotoapparat().takePicture();

    photoResult.saveToFile(new File(
            getExternalFilesDir("photos"),
            "photo.jpg"
    ));

    photoResult
            .toBitmap(scaled(0.25f))
            .whenAvailable(new PendingResult.Callback<BitmapPhoto>() {
                @Override
                public void onResult(BitmapPhoto result) {
                    ImageView imageView = (ImageView) findViewById(R.id.result);

                    imageView.setImageBitmap(result.bitmap);
                    imageView.setRotation(-result.rotationDegrees);
                }
            });
}

`

I can read from photo.jpg and then save to byte array variable . But how to directly read the photo data as byte array? Thank you

Rotate Screen camera zoomed

can you check it ,please.When i rotate screen portait to landscape, camera in landscape mode is zoomed,when i rotate back it normal.

IllegalStateException - a.k - Critical exception reported by Firebug

 Exception java.lang.IllegalStateException: Preview stream is null. Make sure camera is opened.
io.fotoapparat.a.d.a.k ()
io.fotoapparat.a.d.a.h ()
io.fotoapparat.h.c.run ()
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
java.lang.Thread.run (Thread.java:818)

The device : BLU STUDIO C 5+5
Android OS: 5.0

CameraView in a RecyclerView

If I put a CameraView in a RecyclerView, and then scroll away from it for more than a few seconds, when I scroll back it is gone (or at least the preview is no longer showing).

Front Camera Issue (Not Capturing)

In some devices i faced an issue that its not capturing the Photo by the front camera.

Ex: One Plus 2 etc...

Sorry for no logs as its not showing any.

Front Camera still crash

fotoapparat = Fotoapparat
.with(this)
.into(cameraView)
.photoSize(standardRatio(biggestSize()))
.previewSize(standardRatio(biggestSize()))
.lensPosition(front())
.focusMode(firstAvailable(
continuousFocus(),
autoFocus(),
fixed()
))
.flash(firstAvailable(
autoRedEye(),
autoFlash(),
torch()
))
.logger(loggers(
logcat(),
fileLogger(this)
))
.build();

PID: 25731
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:118)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20)
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:97)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:164)
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:116)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20) 
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:97) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:164)
at io.fotoapparat.result.PendingResult$1.call(PendingResult.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
Caused by: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at io.fotoapparat.hardware.v2.parameters.CaptureRequestBuilder.validate(CaptureRequestBuilder.java:113)
at io.fotoapparat.hardware.v2.parameters.CaptureRequestBuilder.build(CaptureRequestBuilder.java:103)
at io.fotoapparat.hardware.v2.parameters.CaptureRequestFactory.createCaptureRequest(CaptureRequestFactory.java:129)
at io.fotoapparat.hardware.v2.lens.operations.LensOperationsFactory.createCaptureOperation(LensOperationsFactory.java:83)
at io.fotoapparat.hardware.v2.lens.executors.CaptureExecutor.takePicture(CaptureExecutor.java:27)
at io.fotoapparat.hardware.v2.Camera2.takePicture(Camera2.java:151)
at io.fotoapparat.routine.TakePictureTask$1.call(TakePictureTask.java:33)
at io.fotoapparat.routine.TakePictureTask$1.call(TakePictureTask.java:16)
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818)

This error was solved when i remove the flash section

fotoapparat = Fotoapparat
.with(this)
.into(cameraView)
.photoSize(standardRatio(biggestSize()))
.previewSize(standardRatio(biggestSize()))
.lensPosition(front())
.focusMode(firstAvailable(
continuousFocus(),
autoFocus(),
fixed()
))
.logger(loggers(
logcat(),
fileLogger(this)
))
.build();

So what will happen if some devices have front facing flash....

and can you please provide a method to flip the front face selfie?

Crash

I am getting this crash via crashlytics

Fatal Exception: java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:789)
at java.util.HashMap$KeyIterator.next(HashMap.java:814)
at java.util.Collections.max(Collections.java:1626)
at io.fotoapparat.parameter.selector.SizeSelectors$1.select(SizeSelectors.java:23)
at io.fotoapparat.parameter.selector.SizeSelectors$1.select(SizeSelectors.java:20)
at io.fotoapparat.parameter.selector.Selectors$2.select(Selectors.java:56)
at io.fotoapparat.parameter.provider.InitialParametersProvider.putPreviewSize(InitialParametersProvider.java:67)
at io.fotoapparat.parameter.provider.InitialParametersProvider.initialParameters(InitialParametersProvider.java:48)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

Improve logging when null params

When Parameters have either a null FOCUS_MODE or FLASH parameter in camera2, when taking a photo FA will crash with a not explicit stacktrace.

Samsung: taking a picture never resolves the pending result

I.e. the 'whenAvailable(..)' callback is never invoked for some reason.
Same story when I do the same thing with the synchronous .await()
I'm using the same code as you have on your main github page.

Tested with:
Samsung S6 Edge (Android 6.0.1): Failed
Samsung S8 (Android 7.0): Failed
Samsung S5 (6.0.1): Failed
LG Nexus 5X (7.1.2): Success

Will test Google Pixel C Tablet tomorrow.

I never waited more than 15 minutes for the callback to be invoked.

I was replacing my old camera-handling code with Fotoapparat while updating an existing project, the old code still works fine so I doubt it's a hardware issue.

java.lang.IllegalArgumentException

I get a lot of crashlogs on devices with Android 4.2 and 4.4 (most are Samsung):

java.lang.IllegalArgumentException: 
  at io.fotoapparat.parameter.provider.InitialParametersValidator.validate(c.java:0)
                                                                  validateParameter
  at io.fotoapparat.parameter.provider.InitialParametersValidator.validate(c.java:0)
                                                                  validateParameter
  at io.fotoapparat.parameter.provider.InitialParametersProvider.initialParameters(b.java:0)
                                                                 putPreviewSize
                                                                 photoSize
  at io.fotoapparat.routine.StartCameraRoutine.run(d.java:0)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:841)

I'm only using this code:

fotoapparat = Fotoapparat
                    .with(this)
                    .into(cameraView)
                    .lensPosition(front())
                    .build();

autofocus() callback

Hi, thank you very much for your time. is there any way to get the autofocus callback? seems like FocusResult is not available from getCurrentFotoapparat().autoFocus();

Thank you again.

FrameProcessor - Byte Array to Bitmap

I try to convert frame.image(Byte Array) to Bitmap with this code
BitmapFactory.decodeByteArray(frame.image, 0, frame.image.length);

But, bitmap always return null. How can I convert frame.image to bitmap?

Logcat message: --- SkImageDecoder::Factory returned null

Preview in Camera2 is lagging

Preview of Camera2 is significantly slower than preview of Camera1 while using the same device (in particular on Moto G3).

I already did some research and asked the question (with a bounty on it) on StackOverflow: http://stackoverflow.com/q/43687624/926907

If we won't get our answer until bounty expires we'll have to drop support of frame processors in Camera2.

Best practice for showing full uncropped sensor in CameraView?

I am curious to know if there is a simple solution that I am overlooking (there probably is, I am not yet great with layouts). I am wanting my cameraView to show the full uncropped sensor. I was thinking that the following would work in my layout:

<!--NOTE THIS IS FOR PORTRAIT VIEW-->
<io.fotoapparat.view.CameraView
android:id="@+id/camera_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>

But it is still cropping to fill the screen. I worked out a solution by programmatically setting the width to the screen width, getting the biggest size photo parameter, figuring out the aspect ratio from that parameter and then setting the view height based on the calculated aspect ratio. I feel like this should work for most purposes but there may be edge cases where this breaks. What is the best practice for showing the full uncropped camera preview? Thank you for this amazing library, it has been extremely helpful to me and has been great to work with.

onResult not called in android N

First of all thanks for your great library, I've ran sample code into android emulator API version 25, but onResult not called in photoResult for saved image, I've test your code in Sony API 23 and it's work fine.

Can you help me to fix this issue.

What about recording videos too?

This is a good and reliable library, but it is not complete. Taking picture AND recording video are bound together. One without another is a 3 wheeled Lamborghini.

NPE version 1.0.0

I dont know if you have seen this one before or if it is fixed in 1.0.1

Fatal Exception: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:125)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20)
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:97)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:164)
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:123)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20)
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:97)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at io.fotoapparat.result.transformer.BitmapPhotoTransformer.transform(BitmapPhotoTransformer.java:30)
at io.fotoapparat.result.transformer.BitmapPhotoTransformer.transform(BitmapPhotoTransformer.java:13)
at io.fotoapparat.result.PendingResult$1.call(PendingResult.java:55)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

Samsung Galaxy S5. Camera is not starting

04-24 15:45:32.639 19867-19894/io.fotoapparat.sample I/OpenGLRenderer: Initialized EGL, version 1.4
04-24 15:45:32.649 19867-19893/io.fotoapparat.sample W/ArrayUtils: Ignoring invalid value emboss
04-24 15:45:32.649 19867-19893/io.fotoapparat.sample W/ArrayUtils: Ignoring invalid value sketch
04-24 15:45:32.649 19867-19893/io.fotoapparat.sample W/ArrayUtils: Ignoring invalid value neon
04-24 15:45:32.649 19867-19893/io.fotoapparat.sample I/CameraManager: Using legacy camera HAL.
04-24 15:45:32.669 19867-19894/io.fotoapparat.sample I/OpenGLRenderer: HWUI protection enabled for context , &this =0xaf722088 ,&mEglDisplay = 1 , &mEglConfig = 8
04-24 15:45:32.679 19867-19894/io.fotoapparat.sample D/OpenGLRenderer: Enabling debug mode 0
04-24 15:45:32.749 19867-19867/io.fotoapparat.sample I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@2f1180cc time:32426103
04-24 15:45:32.959 19867-19893/io.fotoapparat.sample W/ArrayUtils: Ignoring invalid value emboss
04-24 15:45:32.959 19867-19893/io.fotoapparat.sample W/ArrayUtils: Ignoring invalid value sketch
04-24 15:45:32.959 19867-19893/io.fotoapparat.sample W/ArrayUtils: Ignoring invalid value neon
04-24 15:45:32.979 19867-19893/io.fotoapparat.sample D/Fotoapparat: getCapabilities
04-24 15:45:32.979 19867-19893/io.fotoapparat.sample D/Fotoapparat: updateParameters
04-24 15:45:32.979 19867-19893/io.fotoapparat.sample D/Fotoapparat: setDisplayOrientation
04-24 15:45:32.979 19867-19893/io.fotoapparat.sample D/Fotoapparat: getRendererParameters
04-24 15:45:32.979 19867-19893/io.fotoapparat.sample D/Fotoapparat: setDisplaySurface
04-24 15:45:32.979 19867-19893/io.fotoapparat.sample D/Fotoapparat: startPreview
04-24 15:45:32.989 19867-19893/io.fotoapparat.sample E/CameraDevice-0-LE: Surface with size (w=1440, h=1920) and format 0x1 is not valid, size not in valid set: [1920x1080, 1440x1080, 1280x720, 1056x864, 960x720, 800x480, 720x480, 640x480, 352x288, 320x240, 176x144]
04-24 15:45:32.989 19867-19893/io.fotoapparat.sample W/CameraDevice-JV-0: Stream configuration failed
04-24 15:45:32.989 19867-19893/io.fotoapparat.sample E/CameraCaptureSession: Session 0: Failed to create capture session; configuration failed

NoSuchElementException version 1.0.1

we are still getting this on HTCs in 1.0.1
OS Version 6.0
Model Number HTC One_M8

FATAL EXCEPTION: pool-4-thread-1
Process: com.groundcontrol.apps.android.maint, PID: 24826
java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:789)
at java.util.HashMap$KeyIterator.next(HashMap.java:814)
at java.util.Collections.max(Collections.java:1630)
at io.fotoapparat.parameter.selector.SizeSelectors$1.select(SizeSelectors.java:23)
at io.fotoapparat.parameter.selector.SizeSelectors$1.select(SizeSelectors.java:20)
at io.fotoapparat.parameter.selector.Selectors$2.select(Selectors.java:56)
at io.fotoapparat.parameter.selector.Selectors$1.select(Selectors.java:26)
at io.fotoapparat.parameter.provider.InitialParametersProvider.putPreviewSize(InitialParametersProvider.java:69)
at io.fotoapparat.parameter.provider.InitialParametersProvider.initialParameters(InitialParametersProvider.java:50)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

takePicture never called

Hey guys, thanks for this very useful library.

Problem:
When using a Moto G4, I can take a picture once. But the second time I try to take a picture, it doesn't work.

Details:

  • When it fails, I see autoFocus in the Fotoapparat logs, but takePicture never shows up.
  • The OS version was api 25
  • I tried this on 4 phones:
    • Samsung S5: no issue
    • Samsung S6: no issue
    • Moto G: no issue
    • Moto G4: fails
  • Snippet where I initialize fotoapparat:
fotoapparat = Fotoapparat
                .with(this)
                .into(cameraView)
                .lensPosition(back())
                .logger(loggers(logcat()))
                .focusMode(firstAvailable(  
                       continuousFocus(),
                       autoFocus(),        
                       fixed()             
                ))
                .photoSize(wideRatio(biggestSize()))
                .build();
  • If I change the snippet to:
fotoapparat = Fotoapparat
                .with(this)
                .into(cameraView)
                .lensPosition(back())
                .logger(loggers(logcat()))
                .focusMode(autoFocus()) //  <---  this line changed
                .photoSize(wideRatio(biggestSize()))
                .build();

this issue doesn't arise. But then obviously I can't use continuous focus mode.

Unfortunately, I don't have access to the problematic device right now, so I can't do additional testing. If this issue isn't solved because of that, feel free to close it, and I can open an issue again when I get access to the device.

With camera1, getting "IllegalStateException: Camera error code: 1"

Since d8fad94, my app now crashes with this backtrace:

java.lang.IllegalStateException: Camera error code: 1
 at io.fotoapparat.hardware.v1.Camera1$1.onError(Camera1.java:73)
 at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1146)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:154)
 at android.app.ActivityThread.main(ActivityThread.java:6121)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

When camera2 was the default, the app did not have this problem.

setParamaters Crash on Haiwai,1.0.2

Fatal Exception: java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Camera.java)
at android.hardware.Camera.setParameters(Camera.java:2028)
at io.fotoapparat.hardware.v1.Camera1.updateParameters(Camera1.java:178)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)

Videoapparat?

Hey guys, thanks for this awesome library. I just wanted to check out with you, whether you plan to implement video capabilities. Is it planed or already implemented/possible to implement?

Disable Camera2 for first release

Sadly there are still many unresolved issues in Camera2. To not delay the release we'll turn off Camera2 implementation and will bring it back in future versions. API and design for supporting different Camera implementations remain untouched.

Crash version 1.0.0

Fatal Exception: java.lang.IllegalArgumentException: Opened camera does not support the selected focus_mode options.
at io.fotoapparat.parameter.provider.InitialParametersValidator.validateParameter(InitialParametersValidator.java:31)
at io.fotoapparat.parameter.provider.InitialParametersValidator.validate(InitialParametersValidator.java:24)
at io.fotoapparat.parameter.provider.InitialParametersProvider.initialParameters(InitialParametersProvider.java:52)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)

I am getting this on 1.0.0, if it now fixed then I am sorry to bother you

Issue About After Take a Picture

After taking pictures will be stuck for a while, this problem can be improved?But the system camera after taking pictures, will not be stuck for a while
Please help me out this problem。thankyou

Camera mode forcing.

Is there anyway I can use this library in a way where I am forcing it to only use the front facing camera?

Add the ability to implement your own SizeSelector

If you'd like to use other resolution than the provided biggestSize() and smallestSize() you can't or at least it's not documented. I'd like to do some JNI image processing and for that I need to find a sweet spot between the max and min resolutin.

Crash on parameters

When there is no flash support in mobile it crashes.

java.lang.NullPointerException
at io.fotoapparat.hardware.v1.capabilities.CapabilitiesFactory.extractFlashModes(CapabilitiesFactory.java:57)
at io.fotoapparat.hardware.v1.capabilities.CapabilitiesFactory.fromParameters(CapabilitiesFactory.java:29)
at io.fotoapparat.hardware.v1.Camera1.getCapabilities(Camera1.java:187)

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.