Repository navigation
Commit 0851c39
authored
[image_picker] Fix scaling 10-bit images (flutter#12557)
Resizing a 10-bit wide-gamut UIImage can carry its source renderer format into UIGraphicsImageRenderer. On iOS 26 this can request an unsupported 10-bit integer bitmap context, producing a zero-size image and an empty XFile after JPEG conversion.
This change renders scaled images with a standard-range format while preserving the source scale and opacity. The native regression test synthesizes a Display-P3 kCIFormatRGB10 image and verifies that the same 1920-pixel and JPEG-quality path produces a non-empty, decodable image.
Fixes flutter#185623.
## Tests
- dart run script/tool/bin/flutter_plugin_tools.dart format --packages=image_picker_ios
- dart run script/tool/bin/flutter_plugin_tools.dart analyze --packages=image_picker_ios
- dart run script/tool/bin/flutter_plugin_tools.dart dart-test --packages=image_picker_ios
- dart run script/tool/bin/flutter_plugin_tools.dart native-test --ios --no-integration --packages=image_picker_ios
- Focused native regression test verified failing before the production change and passing afterward on an iPhone 17 simulator running iOS 26.
## Pre-Review Checklist1 parent 13b5214 commit 0851c39
4 files changed
Lines changed: 54 additions & 3 deletions
File tree
- packages/image_picker/image_picker_ios
- example/ios/RunnerTests
- ios/image_picker_ios/Sources/image_picker_ios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
263 | 306 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | | - | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments