fluttercandies / flutter_image_compress

flutter image compress
MIT License
632 stars 215 forks source link

[Bug report] Not existing file returned but no error when fed a video instead of an image file #283

Open escamoteur opened 7 months ago

escamoteur commented 7 months ago

Version

2.1.0

Platforms

iOS

Device Model

all devices

flutter info

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.19045.3930], locale de-DE)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.3)
[√] Android Studio (version 2022.3)
[√] VS Code (version 1.85.1)
[√] Connected device (3 available)
[√] Network resources

How to reproduce?

We accidentally fed a live image video part on iOS to compressAndGetFile and it didn't throw an exception or returned null. Still, it returned a seemingly valid XFile that threw a "File not found" exception when we tried to access it. this made it pretty difficult to find the real source of this error

Logs

No response

Example code (optional)

No response

Contact

No response