openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
866 stars 285 forks source link

Use isolates for image compression #3686

Open monsieurtanuki opened 1 year ago

monsieurtanuki commented 1 year ago

Use isolates for image compression (uploaded cropped JPEG) with the new flutter 3.7 feature: background isolate channels. With isolates we won't have the stuttering side-effect of intensive compression computations, e.g. the circular progress indicator when sending a new cropped image will play perfectly.

Originally posted by @monsieurtanuki in https://github.com/openfoodfacts/smooth-app/issues/3682#issuecomment-1422180984

Part of

Skdahale commented 1 year ago

Can I work on this issue

monsieurtanuki commented 1 year ago

@Skdahale Please work on it. As far as I understand the referenced links, it should be a simple init in the main and a compute for each call.

Skdahale commented 1 year ago

Yes, but where is the reference link what is path

monsieurtanuki commented 1 year ago

@Skdahale

Use isolates for image compression (uploaded cropped JPEG) with the new flutter 3.7 feature: background isolate channels.

Skdahale commented 1 year ago

main.zip

I added compressImage flutter image compression

monsieurtanuki commented 1 year ago

If you've coded something that you want to be merged, please create a branch locally and send a Pull Request.

Skdahale commented 1 year ago

Yes, sir but please check isn't correct

monsieurtanuki commented 1 year ago

Don't worry, if you send a Pull Request that is not correct I'll let you know anyway.