Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.13+3

* Fixes a performance regression on iOS where picking videos could cause a long delay due to transcoding. The picker is now configured to request the original asset to avoid conversion.

## 0.8.13+2

* Updates to Pigeon 26.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,28 @@ - (void)testPickMultiVideoWithoutLimit {
XCTAssertEqual(plugin.callContext.maxItemCount, 0);
}

- (void)testPickVideoSetsCurrentRepresentationMode API_AVAILABLE(ios(14)) {
id mockPickerViewController = OCMClassMock([PHPickerViewController class]);
OCMStub(ClassMethod([mockPickerViewController alloc])).andReturn(mockPickerViewController);
OCMExpect([mockPickerViewController
initWithConfiguration:[OCMArg checkWithBlock:^BOOL(PHPickerConfiguration *config) {
return config.preferredAssetRepresentationMode ==
PHPickerConfigurationAssetRepresentationModeCurrent;
}]])
.andReturn(mockPickerViewController);

FLTImagePickerPlugin *plugin = [[FLTImagePickerPlugin alloc] init];
id partialPlugin = OCMPartialMock(plugin);
id mockViewController = OCMClassMock([UIViewController class]);
OCMStub([partialPlugin viewControllerWithWindow:OCMOCK_ANY]).andReturn(mockViewController);

[plugin pickVideoWithSource:[FLTSourceSpecification makeWithType:FLTSourceTypeGallery
camera:FLTSourceCameraRear]
maxDuration:nil
completion:^(NSString *_Nullable result, FlutterError *_Nullable error){
}];

OCMVerifyAll(mockPickerViewController);
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ - (void)launchPHPickerWithContext:(nonnull FLTImagePickerMethodCallContext *)con
PHPickerConfiguration *config =
[[PHPickerConfiguration alloc] initWithPhotoLibrary:PHPhotoLibrary.sharedPhotoLibrary];
config.selectionLimit = context.maxItemCount;
config.preferredAssetRepresentationMode = PHPickerConfigurationAssetRepresentationModeCurrent;
NSMutableArray<PHPickerFilter *> *filters = [[NSMutableArray alloc] init];
if (context.includeImages) {
[filters addObject:[PHPickerFilter imagesFilter]];
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker_ios
description: iOS implementation of the image_picker plugin.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.8.13+2
version: 0.8.13+3

environment:
sdk: ^3.9.0
Expand Down