Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Revert "[image_picker] add forceFullMetadata to interface" #4314

Merged
merged 3 commits into from
Sep 6, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class ImagePickerPlugin extends ImagePickerPlatform {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) {
String? capture = computeCaptureAttribute(source, preferredCameraDevice);
Expand Down Expand Up @@ -116,7 +115,6 @@ class ImagePickerPlugin extends ImagePickerPlatform {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) async {
String? capture = computeCaptureAttribute(source, preferredCameraDevice);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.4.1

* Reverts the changes from 2.4.0, which was a breaking change that
was incorrectly marked as a non-breaking change.

## 2.4.0

* Add `forceFullMetadata` option to `pickImage`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ class MethodChannelImagePicker extends ImagePickerPlatform {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) async {
String? path = await _getImagePath(
source: source,
maxWidth: maxWidth,
maxHeight: maxHeight,
imageQuality: imageQuality,
forceFullMetadata: forceFullMetadata,
preferredCameraDevice: preferredCameraDevice,
);
return path != null ? PickedFile(path) : null;
Expand Down Expand Up @@ -87,7 +85,6 @@ class MethodChannelImagePicker extends ImagePickerPlatform {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) {
if (imageQuality != null && (imageQuality < 0 || imageQuality > 100)) {
Expand All @@ -110,7 +107,6 @@ class MethodChannelImagePicker extends ImagePickerPlatform {
'maxWidth': maxWidth,
'maxHeight': maxHeight,
'imageQuality': imageQuality,
'forceFullMetadata': forceFullMetadata,
'cameraDevice': preferredCameraDevice.index
},
);
Expand Down Expand Up @@ -187,15 +183,13 @@ class MethodChannelImagePicker extends ImagePickerPlatform {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) async {
String? path = await _getImagePath(
source: source,
maxWidth: maxWidth,
maxHeight: maxHeight,
imageQuality: imageQuality,
forceFullMetadata: forceFullMetadata,
preferredCameraDevice: preferredCameraDevice,
);
return path != null ? XFile(path) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ abstract class ImagePickerPlatform extends PlatformInterface {
/// image types such as JPEG. If compression is not supported for the image that is picked,
/// a warning message will be logged.
///
/// `forceFullMetadata` defaults to `true`, so the plugin tries to get the full image metadata which may require
/// extra permission requests on certain platforms.
/// If `forceFullMetadata` is set to `false`, the plugin fetches the image in a way that reduces permission requests
/// from the platform (e.g. on iOS the plugin won’t ask for the `NSPhotoLibraryUsageDescription` permission).
///
/// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera].
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
/// Defaults to [CameraDevice.rear]. Note that Android has no documented parameter for an intent to specify if
Expand All @@ -78,7 +73,6 @@ abstract class ImagePickerPlatform extends PlatformInterface {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) {
throw UnimplementedError('pickImage() has not been implemented.');
Expand Down Expand Up @@ -170,11 +164,6 @@ abstract class ImagePickerPlatform extends PlatformInterface {
/// image types such as JPEG. If compression is not supported for the image that is picked,
/// a warning message will be logged.
///
/// `forceFullMetadata` defaults to `true`, so the plugin tries to get the full image metadata which may require
/// extra permission requests on certain platforms.
/// If `forceFullMetadata` is set to `false`, the plugin fetches the image in a way that reduces permission requests
/// from the platform (e.g. on iOS the plugin won’t ask for the `NSPhotoLibraryUsageDescription` permission).
///
/// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera].
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
/// Defaults to [CameraDevice.rear]. Note that Android has no documented parameter for an intent to specify if
Expand All @@ -190,7 +179,6 @@ abstract class ImagePickerPlatform extends PlatformInterface {
double? maxWidth,
double? maxHeight,
int? imageQuality,
bool forceFullMetadata = true,
CameraDevice preferredCameraDevice = CameraDevice.rear,
}) {
throw UnimplementedError('getImage() has not been implemented.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/image_picker
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.4.0
version: 2.4.1

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ void main() {
'maxWidth': null,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 1,
'maxWidth': null,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
],
);
Expand Down Expand Up @@ -95,56 +93,49 @@ void main() {
'maxWidth': null,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': null,
'maxHeight': 10.0,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': 20.0,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': null,
'imageQuality': 70,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': null,
'maxHeight': 10.0,
'imageQuality': 70,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': 20.0,
'imageQuality': 70,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
],
);
Expand Down Expand Up @@ -205,7 +196,6 @@ void main() {
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
}),
],
);
Expand All @@ -225,7 +215,6 @@ void main() {
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 1,
'forceFullMetadata': true,
}),
],
);
Expand Down Expand Up @@ -520,16 +509,14 @@ void main() {
'maxWidth': null,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 1,
'maxWidth': null,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
],
);
Expand Down Expand Up @@ -575,56 +562,49 @@ void main() {
'maxWidth': null,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': null,
'maxHeight': 10.0,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': 20.0,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': null,
'imageQuality': 70,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': null,
'maxHeight': 10.0,
'imageQuality': 70,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
isMethodCall('pickImage', arguments: <String, dynamic>{
'source': 0,
'maxWidth': 10.0,
'maxHeight': 20.0,
'imageQuality': 70,
'cameraDevice': 0,
'forceFullMetadata': true,
'cameraDevice': 0
}),
],
);
Expand Down Expand Up @@ -684,7 +664,6 @@ void main() {
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 0,
'forceFullMetadata': true,
}),
],
);
Expand All @@ -704,7 +683,6 @@ void main() {
'maxHeight': null,
'imageQuality': null,
'cameraDevice': 1,
'forceFullMetadata': true,
}),
],
);
Expand Down