Skip to content

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

@jeremiahlukus

Description

@jeremiahlukus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 2.0Found to occur in 2.0has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions