Repository navigation
Description
Describe the bug
On iOS, with file_picker 13.1.0 (file_picker_darwin 2.3.1), picking a Live Photo from the photo library loads the whole Live Photo package, including its paired video, and copies all of it into the app's temporary directory. The plugin then returns only the still image from that copy. The rest of the copied package, video included, stays in the temporary directory. The still image is also found by file extension, which depends on what happens to be inside the package.
Platform
- Android
- iOS
- Web
- Desktop
Platform OS version
iOS 26.6.2 (iPhone 13 Pro)
How are you picking?
final files = await FilePicker.pickFiles(type: FileType.media);Details to reproduce the issue
This needs a real iPhone, to take a Live Photo.
- On the iPhone, take a Live Photo, and, for comparison, a photo with Live off.
- Create the repro app, with the
lib/main.dartbelow, and run it on the iPhone:flutter create --platforms=ios livephoto_repro cd livephoto_repro flutter pub add file_picker:13.1.0 # Replace lib/main.dart with the file below, then: flutter run
- Tap Pick a Live Photo, and pick the Live Photo. The app shows the returned file, then lists everything file_picker copied for that pick, with sizes.
- Expected: the still image, copied on its own, without the video.
- Actual: the still image, but at a path inside a copied
.pvtpackage undertmp/<UUID>/, with the paired.movcopied next to it, and left there. The app's output (paths shortened):So most of the copy, the 5.7 MB video, is never used.name: IMG_9329.HEIC path: …/tmp/1C06ECD2-F187-4BB7-A555-99660DEECCFA/IMG_9329.pvt/IMG_9329.HEIC Copied for this pick: IMG_9329.pvt/IMG_9329.MOV (5653097 bytes) IMG_9329.pvt/IMG_9329.HEIC (967977 bytes) IMG_9329.pvt/metadata.plist (256 bytes) Total: 6621330 bytes
- For comparison, pick the photo taken with Live off. Just that image is copied, directly under
tmp/<UUID>/.
Repro app: lib/main.dart
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(const MaterialApp(home: ReproPage()));
class ReproPage extends StatefulWidget {
const ReproPage({super.key});
@override
State<ReproPage> createState() => _ReproPageState();
}
class _ReproPageState extends State<ReproPage> {
String _log = 'Tap the button, and pick one Live Photo.';
// Lists everything in the folder file_picker made for this pick:
// its own new folder, directly inside the app's `tmp` directory.
// (If the path isn't under `tmp`, lists the file's own folder.)
String _describeCopy(String path) {
var dir = File(path).parent;
for (var d = dir; d.parent.path != d.path; d = d.parent) {
if (d.parent.uri.pathSegments.where((s) => s.isNotEmpty).lastOrNull == 'tmp') {
dir = d;
break;
}
}
final lines = <String>['Copied for this pick, under ${dir.path}:'];
var total = 0;
for (final entity in dir.listSync(recursive: true)) {
if (entity is! File) continue;
final size = entity.lengthSync();
total += size;
lines.add(' ${entity.path.substring(dir.path.length + 1)} ($size bytes)');
}
lines.add('Total: $total bytes');
return lines.join('\n');
}
Future<void> _pick() async {
String text;
try {
final files = await FilePicker.pickFiles(type: FileType.media);
if (files.isEmpty) {
text = 'Empty result (as if cancelled).';
} else {
text = files.map((f) => 'name: ${f.name}\npath: ${f.path}\n\n'
'${f.path == null ? '(no path)' : _describeCopy(f.path!)}').join('\n\n');
}
} on PlatformException catch (e) {
text = 'PlatformException: code ${e.code}, message ${e.message}';
}
debugPrint(text);
setState(() => _log = text);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Live Photo repro')),
body: ListView(padding: const EdgeInsets.all(16), children: [
FilledButton(onPressed: _pick, child: const Text('Pick a Live Photo')),
const SizedBox(height: 16),
SelectableText(_log),
]));
}
}Error Log
N/A
Screenshots and/or video
Flutter Version details
Details
$ flutter doctor -v
[!] Flutter (Channel [user-branch], 3.49.0-1.0.pre-314, on macOS 26.5.1 25F80 darwin-arm64, locale en-US) [516ms]
! Flutter version 3.49.0-1.0.pre-314 on channel [user-branch] at /Users/chrisbobbe/.local/lib/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, try deleting the 'bin/cache/flutter.version.json' file in your Flutter SDK directory and then
reinstall Flutter by following instructions at https://flutter.dev/setup.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3611dd5889 (9 days ago), 2026-10-05 23:43:21 +0000
• Engine revision d7fe60992f
• Dart version 3.14.0 (build 3.14.0-294.0.dev)
• DevTools version 2.61.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file,
enable-lldb-debugging, enable-uiscene-migration, enable-riscv64, enable-hcpp
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform
update checks and upgrades.
[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [2.0s]
• Android SDK at /Users/chrisbobbe/Library/Android/sdk
• Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• ANDROID_HOME = /Users/chrisbobbe/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.10+-117844308-b1163.108)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.6) [1,047ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17F113
• CocoaPods version 1.17.0
[✓] Chrome - develop for the web [5ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (4 available) [10.0s]
• Chris’s iPhone (mobile) • 00008110-000924383632801E • ios • iOS 26.6.2 23G90
• iPhone 15 Pro (mobile) • D2E5855E-A059-4FBB-A9AF-117C12378F4F • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-5
(simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.5.1 25F80 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 155.0.8059.79
[✓] Network resources [183ms]
• All expected network resources are available.
! Doctor found issues in 2 categories.
Additional context
Claude Code helped me trace this in the source (file_picker_darwin 2.3.1):
By default (copyMedia: true), the photo picker loads every item as UTType.item. For a Live Photo, that's the whole .pvt package: "directories containing the still image, the paired .mov, and metadata" (#2157). copyToTemporaryDirectory copies all of it, then returns just the still image. Nothing removes the rest, so the video stays in the temporary directory until the app calls clearTemporaryFiles() or iOS clears that directory.
The still image is found by file extension (jpg, jpeg, heic, heif or png). That works for the packages reported so far, but it depends on what happens to be in the package, and as far as I can find, Apple doesn't document what a Live Photo package contains.
Before the 12.0.0 rewrite, the plugin asked for public.image or public.movie, so the system chose the still image itself. As #2153 put it: "Before update 12.0.0, they were picked as jpeg or .heic."
Suggestion: request UTType.image for an item that conforms to it, and UTType.movie for one that conforms to that. One of #2158's reasons for looking inside the package was that it "Doesn't depend on a specific Live Photo UTType (which can vary across iOS versions)", and UTType.image doesn't either. This avoids loading and copying the video, and the need to find the image by extension. With iCloud Photos' "Optimize iPhone Storage", it also avoids downloading the video, when the original is only in iCloud. Then the photo picker wouldn't need resolveActualFile at all. Removing it would also fix #2259, where the document picker runs it on package-format documents like .rtfd.
Activity
vicajilau commentedon Oct 15, 2026
Fixed in file_picker_darwin 2.3.2 (#2264), already on pub.dev. A Live Photo now loads just its still image, without the bundle or the paired video. One detail we found while testing on a device: a HEIC Live Photo registers
public.jpegbeforepublic.heic, so taking the first image type made the picker transcode it to JPEG. The plugin now prefers the original format, and keeps the JPEG only withDarwinAssetRepresentationMode.compatible. Thanks a lot for the report and the trace!Load only what was picked on iOS and stop storing it twice
deps: Upgrade file_picker to 13.1.0, with the packages that requires
deps: Upgrade file_picker to 13.1.0, with the packages that requires
deps: Upgrade file_picker to 13.1.0, with the packages that requires
Unit test the iOS picker loading with mocked items