Skip to content
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

[Feature request] Return XFile or Path instead of Uint8List for compressions #281

Open
ynnob opened this issue Jan 5, 2024 · 0 comments

Comments

@ynnob
Copy link

ynnob commented Jan 5, 2024

Platforms

dart, Android, iOS, macOS, Web, Windows, Linux

Description

Return the path to the compressed cache file instead of the Uint8List. At the moment, the compression creates a File in the cache directory and only returns the bytes. There is no way to use the file that has been created in the cache directory by the compression method.

Why

Returning only the bytes of the compressed images forces the user to hold all the bytes in memory or save them as duplicates so we can store a path instead of holding them in memory.
In both scenarios, the file is a duplicate because the compression itself already created a file in the cache folder.

This is important if we compress multiple files. The current workflow:
-> Select Images
-> Compress
-> Wait for the user to confirm compression and save to the device.

These lead to duplicate files and unnecessary storage usage if we don't want to hold the files in memory. To avoid the high memory usage, we only store a reference to the file path so we can wait for user input to permanently save the image at a permanent storage location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant