jonataslaw / VideoCompress

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
MIT License
230 stars 279 forks source link

fix: When video name contains space, filePath forget to decode %20 t… #199

Closed unknown-undefined closed 2 years ago

unknown-undefined commented 2 years ago

I'm using video_compress 3.1.1.

If origin video contains space, calling VideoCompress.getFileThumbnail will result in filePath contains %20. Just call Url.decodeFull to decode %20, because File() constructor DONOT need encode path.

jonataslaw commented 2 years ago

Nice catch! Thanks for your contribution!

itzhu commented 9 months ago
// Not to set the result as strong-mode so that it would have exception to
// lead to the failure of compression
final filePath = await (_invoke<String>('getFileThumbnail', {
  'path': path,
  'quality': quality,
  'position': position,
}));

final file = File(Uri.decodeFull(filePath!));   

If the path contains Chinese, there will be an error