Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for HEIC_ULTRAHDR#282

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
epeevs wants to merge2 commits intoandroid:main
base:main
Choose a base branch
Loading
fromepeevs:heic_ultrahdr

Conversation

@epeevs
Copy link
Contributor

No description provided.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Hello@epeevs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds support for theHEIC_ULTRAHDR image format in the camera2 sample application. The changes include updating thecompileSdkPreview andtargetSdkPreview to "Baklava", adding a new classCamera2HeicUltraHDRCapture that extendsCamera2UltraHDRCapture and overrides theULTRAHDR_FORMAT toImageFormat.HEIC_ULTRAHDR. The pull request also modifiesCamera2UltraHDRCapture to be an open class, and updates the file creation logic to save images as.heic when using theHEIC_ULTRAHDR format. Additionally, the pull request removes EXIF metadata saving and sets the JPEG orientation in the capture request.

Highlights

  • HEIC_ULTRAHDR Support: Adds support for theHEIC_ULTRAHDR image format in the camera2 sample application.
  • API Level Update: UpdatescompileSdkPreview andtargetSdkPreview to "Baklava" (Android 14).
  • File Creation Logic: Modifies the file creation logic to save images as.heic when using theHEIC_ULTRAHDR format.
  • Base Class Modification: ChangesCamera2UltraHDRCapture to an open class to allow extension for specific UltraHDR formats.

Changelog

Click here to see the changelog
  • app/build.gradle.kts
    • UpdatedcompileSdk tocompileSdkPreview = "Baklava".
  • gradle.properties
    • Addedandroid.suppressUnsupportedCompileSdk=35 to suppress compile SDK warnings.
  • samples/camera/camera2/build.gradle.kts
    • AddedcompileSdkPreview = "Baklava" andtargetSdkPreview = "Baklava".
  • samples/camera/camera2/src/main/java/com/example/platform/camera/imagecapture/Camera2HeicUltraHDRCapture.kt
    • Created new classCamera2HeicUltraHDRCapture extendingCamera2UltraHDRCapture.
    • OverrodeULTRAHDR_FORMAT toImageFormat.HEIC_ULTRAHDR.
  • samples/camera/camera2/src/main/java/com/example/platform/camera/imagecapture/Camera2UltraHDRCapture.kt
    • Changed class toopen class Camera2UltraHDRCapture.
    • Addedprotected open val ULTRAHDR_FORMAT = ImageFormat.JPEG_R.
    • Replaced hardcodedImageFormat.JPEG_R withULTRAHDR_FORMAT when creating theImageReader.
    • Removed EXIF metadata saving.
    • Addedrequest.set(CaptureRequest.JPEG_ORIENTATION, relativeOrientation.value ?: 0) to set JPEG orientation.
    • ModifiedcreateFile to use.heic extension forHEIC_ULTRAHDR format.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in issue comments and review comments.
Help/gemini helpDisplays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on@gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.


The camera's eye, a digital soul,
Capturing moments, making them whole.
From JPEG's grace to HEIC's might,
UltraHDR shines, a dazzling light.

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces support for HEIC_ULTRAHDR in the camera2 sample. The changes involve updating build configurations to use the Baklava preview SDK and adding a new class for capturing HEIC Ultra HDR images. Overall, the changes seem reasonable, but there are a few areas that could be improved.

Summary of Findings

  • Target SDK Preview: The targetSdkPreview should be carefully considered as it might introduce compatibility issues if the preview SDK is not available on the device. Ensure proper fallback mechanisms are in place.
  • API Level Check: The code uses@RequiresApi to ensure the new functionality is only used on devices running Android Baklava or higher. This is good, but ensure that the app gracefully handles cases where the API is not available.
  • File Extension Handling: The file extension handling logic increateFile could be simplified and made more robust by usingwhen statement instead ofif statement.

Merge Readiness

The pull request introduces necessary changes to support HEIC_ULTRAHDR. However, before merging, it's crucial to ensure that the targetSdkPreview is handled gracefully and that the API level checks are robust. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. Given themedium severity comments, I recommend addressing them before merging.

Comment on lines +36 to +39
compileSdkPreview="Baklava"
defaultConfig {
targetSdkPreview="Baklava"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider adding a comment explaining whycompileSdkPreview andtargetSdkPreview are being used. This can help future developers understand the purpose of these settings and avoid accidental removal or modification.

Also, ensure that using a preview SDK doesn't introduce unexpected behavior or compatibility issues on older devices. It might be useful to add a check to ensure that the app gracefully handles cases where the preview SDK is not available.

importandroid.os.Build
importandroidx.annotation.RequiresApi

@RequiresApi(Build.VERSION_CODES.BAKLAVA)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The@RequiresApi annotation is good for ensuring that this class is only used on devices running Android Baklava or higher. However, consider adding a fallback mechanism or a check at runtime to handle cases where the API is not available. This could involve disabling the HEIC_ULTRAHDR capture option or providing a message to the user.


@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
classCamera2UltraHDRCapture :Fragment() {
@RequiresApi(Build.VERSION_CODES.BAKLAVA)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to theCamera2HeicUltraHDRCapture.kt file, ensure that the app gracefully handles cases where the API level is not met. Consider providing a fallback mechanism or a user-friendly message.

Comment on lines +327 to 329
// Save the result to disk
val output= saveResult(result)
Log.d(TAG,"Image saved:${output.absolutePath}")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The EXIF metadata update is removed. Is this intentional? If so, please add a comment explaining why the EXIF metadata update is no longer needed for UltraHDR images. If it was unintentional, please re-add the EXIF metadata update logic.

…ra/imagecapture/Camera2UltraHDRCapture.ktCo-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@epeevs

[8]ページ先頭

©2009-2025 Movatter.jp