numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
941 stars 88 forks source link

[BUG] exported video PHAsset stays in tmp folder and dramatically increases application storage size #294

Open iserzh opened 5 months ago

iserzh commented 5 months ago

Current behavior

After compressing a local video asset (PHAsset), a temporary file (not the compressed one) will remain in storage, increasing the application size.

It is not possible to clean an exported PHAsset on the consumer side due to a lack of tmp path support from compressVideo in react-native-compression. This results in two files being created: a compressed file and an exported file before compression.

Expected behavior

Tmp files should be removed after compression or compressVideo should privde url to manually remove this file

Platform

React Native Version

0.73.2

React Native Compressor Version

1.8.24

Reproducible Steps And Demo

  1. Compress PHAsset (something from camera roll)
  2. Remove file that was returned from compressVideo method
  3. Check app storage usage or list files in tmp directory
github-actions[bot] commented 5 months ago

👋 @iserzh Thanks for opening your issue here! If you find this package useful hit the star🌟!