Closed laeo closed 11 months ago
Picked photos cannot get its original bytes or File object or MIME info, and i can't have filename.
static MediaViewModel _toMediaViewModel(AssetEntity entity) { var mediaType = MediaType.all; if (entity.type == AssetType.video) mediaType = MediaType.video; if (entity.type == AssetType.image) mediaType = MediaType.image; return MediaViewModel( id: entity.id, thumbnailAsync: entity.thumbnailDataWithSize(ThumbnailSize(200, 200)), type: mediaType, thumbnail: null, videoDuration: entity.type == AssetType.video ? entity.videoDuration : null, ); }
I see AssetEntity has originFile and mimeTypeAsync attributes, we can take original image info from originFile, and its mime info from mimeTypeAsync, so we can rename or manipulate it more preciesly.
AssetEntity
originFile
mimeTypeAsync
Picked photos cannot get its original bytes or File object or MIME info, and i can't have filename.
I see
AssetEntity
hasoriginFile
andmimeTypeAsync
attributes, we can take original image info fromoriginFile
, and its mime info frommimeTypeAsync
, so we can rename or manipulate it more preciesly.