Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
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/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.1+9

* Android: Fix fallback of imageQuality so that resizeImageIfNeeded works as expected

## 0.6.1+8

* Fix iOS build and analyzer warnings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,7 @@ private void handleImageResult(String path, boolean shouldDeleteOriginalIfScaled
if (methodCall != null) {
Double maxWidth = methodCall.argument("maxWidth");
Double maxHeight = methodCall.argument("maxHeight");
int imageQuality =
methodCall.argument("imageQuality") == null
? 100
: (int) methodCall.argument("imageQuality");
Integer imageQuality = methodCall.argument("imageQuality");

String finalImagePath =
imageResizer.resizeImageIfNeeded(path, maxWidth, maxHeight, imageQuality);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ class ImageResizer {
* <p>If no resizing is needed, returns the path for the original image.
*/
String resizeImageIfNeeded(
String imagePath, Double maxWidth, Double maxHeight, int imageQuality) {
boolean shouldScale =
maxWidth != null || maxHeight != null || (imageQuality > -1 && imageQuality < 101);
String imagePath, Double maxWidth, Double maxHeight, Integer imageQuality) {
boolean shouldScale = maxWidth != null || maxHeight != null || imageQuality != null;

if (!shouldScale) {
return imagePath;
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
- Flutter Team <[email protected]>
- Rhodes Davis Jr. <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker
version: 0.6.1+8
version: 0.6.1+9

flutter:
plugin:
Expand Down