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

@capacitor/camera take multiple photos via the camera in one session #1616

Open
luke-rogers opened this issue May 24, 2023 · 9 comments
Open

Comments

@luke-rogers
Copy link

Feature Request

Plugin

Camera

Description

Support for taking multiple photos using the camera without having to reopen the camera each time.

Example real-world use case: An inspector who may need to capture photos of an issue from multiple angles.

Platform(s)

  • iOS
  • Android

Preferred Solution

A new method for the camera plugin (e.g. takePhotos) which allows the user to continue taking photos until they confirm they are finished. At which point, Photo[] is returned by the plugin.

Alternatives

Additional Context

Seems like this functionality is available in the cordova-plugin-media-capture captureImage method

@chriscarruthers
Copy link

This would be great to have. 👍

@isbecker
Copy link

isbecker commented Jan 24, 2024

I've been working on this, specifically the Android side. I've made significant progress, but there are some things I'm wondering about.

I noticed that the capacitor-plugins seem to not use layout XML and instead use only code (programmatic) UI layouts.

❓Is there a reason that the project does not use the layout XML?

I ask because in order to support multiple photos, the Android camera plugin will need to use a custom view. Currently the plugin calls the native device camera using an Intent; this approach only allows a single picture at a time.


This leads me to another question:

❓Is the project opposed to using Jetpack Compose?

Jetpack Compose is supposed to be the "new modern" way to do UI for Android.


Finally, last question:

❓Would the project accept contributions to the camera plugin that use Kotlin code?

I have been working in Java only so far, but there are some niceties about Kotlin, so I'm just wondering.

Thanks!

@isbecker
Copy link

Here is a demo video of my work on the multi photo mode.

demo.mp4

I think that it is feature complete. There may be a few more tweaks that I need to make.

Features

  • Tap to Focus
  • Pinch to Zoom
  • Zoom buttons
  • Flash: On / Off / Auto
  • Flip to front-facing: not in this demo video (sorry 😞 I can add a video if requested)
  • Cancel
  • Done: returns the photos to the app that called the plugin

Next steps

I am working on getting the changes into my fork.
I will have that done sometime in the next few days.

iOS

This work in the demo is only for Android.

Getting the same done for iOS will require me to figure out how to setup XCode and I am on Linux and don't have any iOS devices.

isbecker added a commit to isbecker/capacitor-plugins that referenced this issue Jan 29, 2024
@blahblehblah
Copy link

@isbecker any way to use your fork?

@isbecker
Copy link

isbecker commented Apr 22, 2024

Hi @blahblehblah, I think that you should be able to add something like the following to your package.json

"dependencies": {
  "@capacitor/camera": "github:isbecker/capacitor-plugins:camera"
}

@nicholaszuccarelli
Copy link

Sorry to bump, but any update on this for iOS too?

@raul-ruiz-gallardo
Copy link

Hi @isbecker , could you merge your progress in your fork?

@prince-unthinkable
Copy link

Hi @isbecker,

Any Update for IOS part ?

@iwolffy
Copy link

iwolffy commented Nov 28, 2024

When this feature can be completed, it is undoubtedly very useful for users.

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

9 participants