Closed amrsunja closed 1 year ago
Currently, this library read bytes of all media files, causing OOM when the file is too big. Should only load the thumbnail to display.
Future<Media> convertToMedia({required AssetEntity media}) async {
Media convertedMedia = Media();
convertedMedia.file = await media.file;
convertedMedia.mediaByte = await media.originBytes; // <-- here
convertedMedia.thumbnail =
await media.thumbnailDataWithSize(ThumbnailSize(200, 200));
convertedMedia.id = media.id;
convertedMedia.size = media.size;
convertedMedia.title = media.title;
convertedMedia.creationTime = media.createDateTime;
MediaType mediaType = MediaType.all;
if (media.type == AssetType.video) mediaType = MediaType.video;
if (media.type == AssetType.image) mediaType = MediaType.image;
convertedMedia.mediaType = mediaType;
return convertedMedia;
}
Hello @rafid08 I think your package is awesome, but I noticed some problems:
Hey @XuanTung95 Thank you so much for your valuable suggestions. Also I'm extremely sorry for the issue you're facing. The thing is, the time when I developed this package, I was not that expert in flutter. Now I really want to refactor the whole project but I'm currently so busy with some of my other projects. I'm not getting that much time to refactor the project. I'd be glad if you would like do some contributions to this project...
Hi @rafid08, I would love to contribute to this project. Let me see what I can do.
Hi, I'm having this same issue, will be a solution for this soon??
This issue is solved in the last update of 1.0.1
I'm extremely sorry for being late solving this major issue.
In my xiaomi phone I was received this failure when I try to get images and videos from gallery