Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Image Picker] picked file on web isn't being compressed #78170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeremiahlukus opened this issue Mar 14, 2021 · 6 comments Β· Fixed by flutter/plugins#4389
Closed

[Image Picker] picked file on web isn't being compressed #78170

jeremiahlukus opened this issue Mar 14, 2021 · 6 comments Β· Fixed by flutter/plugins#4389
Labels
found in release: 2.0 Found to occur in 2.0 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: image_picker The Image Picker plugin. P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-web Web applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@jeremiahlukus
Copy link

jeremiahlukus commented Mar 14, 2021

I am trying to compress a file before upload in flutter web. However the image isnt being compressed at least not when i readAsBytes this obviously is an issue when uploading images.

    final pickedFile = await picker.getImage(
        source: ImageSource.gallery,
        imageQuality: 10,
        maxHeight: 10,
        maxWidth: 10);

    _webImage = await pickedFile.readAsBytes();

print(pickedFile.length);  // 2360369 ~ 2.3 mb ie the original image size

When getImage is called i expect the image that im getting would be reduced to whatever i compress it to.

@iapicca
Copy link
Contributor

iapicca commented Mar 14, 2021

@jeremiahlukus
if you need assistance with your code please follow the link I want help writing my application in the new issue menu
or, if you are reporting a bug, please provide your flutter doctor -v
and a minimal reproducible code sample without 3rd party plugins

@jeremiahlukus
Copy link
Author

@iapicca

    final pickedFile = await picker.getImage(
        source: ImageSource.gallery,
        imageQuality: 10,
        maxHeight: 10,
        maxWidth: 10);

    _webImage = await pickedFile.readAsBytes();

print(pickedFile.length);  // 2360369 ~ 2.3 mb ie the original image size

Is the minimal reproducible code sample. The I am using the plugins needed for image picker web.
image_picker: ^0.6.7+22
image_picker_for_web: ^0.1.0

[βœ“] Flutter (Channel beta, 2.0.1, on Mac OS X 10.15.7 19H524 darwin-x64, locale en)
    β€’ Flutter version 2.0.1 at /Users/jparrack/phil/flutter
    β€’ Framework revision c5a4b4029c (10 days ago), 2021-03-04 09:47:48 -0800
    β€’ Engine revision 40441def69
    β€’ Dart version 2.12.0

[βœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    β€’ Android SDK at /Users/jparrack/Library/Android/sdk
    β€’ Platform android-30, build-tools 29.0.2
    β€’ ANDROID_HOME = /Users/jparrack/Library/Android/sdk
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 12.4, Build version 12D4e
    β€’ CocoaPods version 1.10.1

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 4.1)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[βœ“] IntelliJ IDEA Ultimate Edition (version 2018.2.5)
    β€’ IntelliJ at /Applications/IntelliJ IDEA.app
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart

[βœ“] VS Code (version 1.53.2)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.16.0

[βœ“] Connected device (2 available)
    β€’ iPhone 12 Pro Max (mobile) β€’ BE0DF70C-94D9-4120-B5A5-53F9FA755D84 β€’ ios            β€’ com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    β€’ Chrome (web)               β€’ chrome                               β€’ web-javascript β€’ Google Chrome 89.0.4389.82

β€’ No issues found!

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 15, 2021
@darshankawar
Copy link
Member

flutter doctor -v
[βœ“] Flutter (Channel stable, 2.0.2, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-GB)
    β€’ Flutter version 2.0.2 at /Users/dhs/documents/Fluttersdk/flutter
    β€’ Framework revision 8962f6dc68 (4 days ago), 2021-03-11 13:22:20 -0800
    β€’ Engine revision 5d8bf811b3
    β€’ Dart version 2.12.1

[!] Xcode - develop for iOS and macOS
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 12.3, Build version 12C33
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] VS Code (version 1.54.1)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.18.1

[βœ“] Connected device (3 available)
    β€’ iPhone 12 Pro Max (mobile) β€’ A5473606-0213-4FD8-BA16-553433949729 β€’ ios
      β€’ com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    β€’ macOS (desktop)            β€’ macos                                β€’
      darwin-x64     β€’ Mac OS X 10.15.4 19E2269 darwin-x64
    β€’ Chrome (web)               β€’ chrome                               β€’
      web-javascript β€’ Google Chrome 89.0.4389.82

! Doctor found issues in 1 category.

@darshankawar darshankawar added p: first party p: image_picker The Image Picker plugin. found in release: 2.0 Found to occur in 2.0 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-web Web applications specifically and removed in triage Presently being triaged by the triage team labels Mar 15, 2021
@stuartmorgan-g stuartmorgan-g added the P2 Important issues not at the top of the work list label Mar 18, 2021
@SeriousMonk
Copy link

Any news on this?

@balvinderz
Copy link
Contributor

image quality is not supported on web
Screenshot 2021-09-20 at 6 09 07 PM

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
found in release: 2.0 Found to occur in 2.0 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: image_picker The Image Picker plugin. P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-web Web applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants