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

Multiplatform ImageViewer desktop camera support #2907

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DevSrSouza
Copy link
Contributor

@DevSrSouza DevSrSouza commented Mar 22, 2023

Clone correct branch: git clone -b feat/imageviewer-desktop-camera https://github.com/DevSrSouza/compose-jb.git

This Pull Request adds support for Camera in Desktop app by using webcam-capture library and converting it RGB ByteArray to Compose/Skiko ARGB to display the image capture as Compose ImageBitmap.

For running the application in MacOS, the apps requires camera permission, so I had to add a runtime-entitlements.plist with com.apple.security.device.camera and infoPlist entry NSCameraUsageDescription.

How to test on MacOS:

  • ./gradlew :desktopApp:createDistributable
  • open desktopApp/build/compose/binaries/main/app/ImageViewer.app
Screen.Recording.2023-03-21.at.21.10.21.mp4

@@ -30,7 +30,14 @@ compose.desktop {

val iconsRoot = project.file("../common/src/desktopMain/resources/images")
macOS {
iconFile.set(iconsRoot.resolve("icon-mac.icns"))
//iconFile.set(iconsRoot.resolve("icon-mac.icns")) does not exist
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was required because it could not find this file.

@dima-avdeev-jb dima-avdeev-jb self-requested a review March 22, 2023 05:11
@@ -15,5 +15,6 @@ allprojects {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
mavenLocal()
maven("https://jitpack.io")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't add jitpack dependencies because of potential security risks.
Also, we can't add this dependency as a jar, because it is not convenient.

@willflier
Copy link

This is now available in maven central. Any update? @DevSrSouza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants