[Bug]: share_plus decodes full-resolution images on the main thread when preparing iOS share previews
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- flutter, ios
- Domain
- mobile, performance
Research direction
Start with the iOS side of share_plus and search for every UIImage imageWithContentsOfFile: call, including the placeholder, thumbnail and link-metadata callbacks. Then read the 120 × 120 drawing in the metadata callback that PR #3320 added. Done means preview images are produced without fully decoding and drawing the original on the calling thread, which you can check by sharing a large photo on an iOS device and watching for main-thread stalls.
Written by the indexing model from the issue text.
Description
Plugin: share_plus 13.3.1
Current stable releases: Flutter 3.47.7 and iOS 27.0.1. These are current-release references; the original report’s exact OS and Flutter versions haven’t been confirmed.
Sharing a high-resolution photo can stall the app while the share sheet prepares its preview. We encountered this with a 48 MP image; the hang trace pointed to synchronous image drawing in the share metadata callback.
The placeholder, thumbnail, and link-metadata callbacks load the original image using UIImage imageWithContentsOfFile:. The metadata callback then draws it into a 120 × 120 context. This limits the resulting preview size, but still requires decoding and drawing the full-resolution source on the calling thread.
PR #3320, which addressed #3322, added that resize. The same implementation remains in 13.3.1 and current main.
Proposed solution
One possible approach is to generate small previews with ImageIO downsampling on a background queue. This could avoid decoding and resizing the full-resolution image inside UIKit’s preview callbacks.
- Dominant language
- Dart
- Stars
- 1.9k
- Forks
- 1.3k
- Avg merge
- 8h 43m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluttercommunity/plus_plugins
-
enhancement triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
fluttercommunity/plus_plugins#4004 ·
Maintainers usually reply within 1 day
-
[Bug]: (share_plus) iOS drops the subject when sharing a uriPossibly taken @kaluli123123 claimed this 13 days ago. Openbug triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
fluttercommunity/plus_plugins#3994 · 1 comment ·
Maintainers usually reply within 1 day
-
[Request]: network_info_plus: use ConnectivityManager for getWifiIP and getWifiGatewayIP from Android 7 (N), so ethernet works below Android 12Possibly taken @redge-munch claimed this 11 days ago. Openenhancement triage
Difficulty 3/5 Half a day Newbie friendliness 22/100
fluttercommunity/plus_plugins#3998 ·
Maintainers usually reply within 1 day
-
[package_info_plus]: Use Flutter's compile-time build name/number on web instead of version.jsonPossibly taken @Ortes claimed this 18 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
fluttercommunity/plus_plugins#3989 ·
Maintainers usually reply within 1 day
-
enhancement triage
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fluttercommunity/plus_plugins#3976 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in fluttercommunity/plus_plugins
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jhomlala/betterplayer#1599 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AimesSoft/NipaPlay-Reload#1021 ·
Maintainers usually reply within 1 day
-
agent:ready bug P2 · 中 健壮性 区域: 启动与合规 待验证 隐私与合规
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
ASDW51/DanmuFloat#106 ·
Maintainers usually reply within 1 day
-
c: proposal p: go_router package team-ecosystem
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
flutter/flutter#194542 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 80/100