ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
534 stars 599 forks source link

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

Open luke-rogers opened 1 year ago

luke-rogers commented 1 year ago

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)

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 commented 1 year ago

This would be great to have. 👍

isbecker commented 10 months ago

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 commented 10 months ago

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

https://github.com/ionic-team/capacitor-plugins/assets/600561/79655986-661d-4586-b05a-6c5c4bebd29d

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

Features

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.

blahblehblah commented 7 months ago

@isbecker any way to use your fork?

isbecker commented 7 months ago

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 commented 3 months ago

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

raul-ruiz-gallardo commented 3 months ago

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

prince-unthinkable commented 2 months ago

Hi @isbecker,

Any Update for IOS part ?

iwolffy commented 5 days ago

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