Skip to content

fix long image sharing#2150

Merged
Tlaster merged 1 commit into
masterfrom
bugfix/share-long-image
May 15, 2026
Merged

fix long image sharing#2150
Tlaster merged 1 commit into
masterfrom
bugfix/share-long-image

Conversation

@Tlaster

@Tlaster Tlaster commented May 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Tlaster Tlaster requested a review from Copilot May 15, 2026 04:08
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes share-image capture for long status posts by replacing the previous GraphicsLayer.toImageBitmap() approach (which is bounded by the on-screen preview size and uses hardware bitmaps incompatible with Bitmap.compress) with an off-screen ComposeView that is measured/laid out with unbounded height and drawn into a software bitmap. Also introduces a LocalNetworkImageAllowHardware composition local so Coil image requests can avoid hardware-backed bitmaps during the capture pass.

Changes:

  • Add expect/actual applyAllowHardware and LocalNetworkImageAllowHardware to toggle Coil's allowHardware per Android (no-op on iOS/JVM).
  • Extract StatusSharePreview / StatusShareCard and rewrite captureShareBitmap to inflate a detached ComposeView into a hidden FrameLayout, measure with UNSPECIFIED height, then draw into a software Bitmap.
  • Disable hardware bitmaps (and incidentally crossfade) for NetworkImage, SubcomposeNetworkImage, and EmojiImage when capturing.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
compose-ui/src/commonMain/kotlin/dev/dimension/flare/ui/component/NetworkImageHardware.kt New expect for applying allowHardware on an ImageRequest.Builder.
compose-ui/src/androidMain/.../NetworkImageHardware.android.kt Android actual delegates to Coil's allowHardware.
compose-ui/src/iosMain/.../NetworkImageHardware.ios.kt iOS actual is a no-op.
compose-ui/src/jvmMain/.../NetworkImageHardware.jvm.kt JVM actual is a no-op.
compose-ui/src/commonMain/kotlin/dev/dimension/flare/ui/component/NetworkImage.kt Adds LocalNetworkImageAllowHardware, threads it through NetworkImage/SubcomposeNetworkImage/EmojiImage, also gates crossfade on the same flag.
app/src/main/java/dev/dimension/flare/ui/screen/status/action/StatusShareSheet.kt Replaces GraphicsLayer capture with off-screen ComposeView + software bitmap; factors out StatusSharePreview/StatusShareCard; sets LocalNetworkImageAllowHardware to false during capture.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.Builder(platformContext)
.data(model)
.crossfade(true)
.crossfade(allowHardware)
@Tlaster Tlaster merged commit 3338e53 into master May 15, 2026
9 checks passed
@Tlaster Tlaster deleted the bugfix/share-long-image branch May 15, 2026 04:50
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.

2 participants