lab-64 / split-the-bill-client

Flutter App for easy and fast splitting up of receipts
4 stars 0 forks source link

Parse images to correct size #139

Open Morvvvv opened 1 month ago

Morvvvv commented 1 month ago
f-odc commented 1 month ago

We could try to set the image quality when selecting the image like it can be done with Image Picker:

  Future getImage() async {
    var image = await ImagePicker.pickImage(
        source: ImageSource.gallery,  
                imageQuality: 25,
    );
  }
Morvvvv commented 1 month ago

It says this for how the quality works:

The imageQuality argument modifies the quality of the image, ranging from 0-100 where 100 is the original/max quality. 
If imageQuality is null, the image with the original quality will be returned.

If this means a quality of 25, will decrease it to 25% of the quality, then this decreases our problem, but does not eliminate it.

f-odc commented 1 month ago

It says this for how the quality works:

The imageQuality argument modifies the quality of the image, ranging from 0-100 where 100 is the original/max quality. 
If imageQuality is null, the image with the original quality will be returned.

If this means a quality of 25, will decrease it to 25% of the quality, then this decreases our problem, but does not eliminate it.

For now, this solution is good enough. This will decrease the probability that the uploaded image is over 4MB large.