fluttercandies / extended_image

A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
https://fluttercandies.github.io/extended_image/
MIT License
1.87k stars 499 forks source link

[Bug report] load lots of file image, sometimes will show too many files open #639

Open q2564063 opened 7 months ago

q2564063 commented 7 months ago

Version

8.1.1

Platforms

dart, iOS

Device Model

iPhone 13

flutter info

[✓] Flutter (Channel stable, 3.13.8, on macOS 14.0 23A344 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.13.8 on channel stable at /Users/bmi/fvm/versions/3.13.8
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6c4930c4ac (5 weeks ago), 2023-10-18 10:57:55 -0500
    • Engine revision 767d8c75e8
    • Dart version 3.1.4
    • DevTools version 2.25.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/bmi/Library/Android/sdk
    • Platform android-33, build-tools 34.0.0
    • ANDROID_HOME = /Users/bmi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

How to reproduce?

use ExtendedImage.file method to load lots of file images. I found the source code not to cache the file object, which will cause the files open too many times, the 'too many files open' error shows.

Logs

No response

Example code (optional)

No response

Contact

No response

zmtzawqlp commented 7 months ago

The same as Image.file, it's better to provide a runnable demo to reproduce it

q2564063 commented 7 months ago

I think use custom ImageProvider with flutter_cache_manager might fix it. It's not easy to reproduce.

The same as Image.file, it's better to provide a runnable demo to reproduce it

zmtzawqlp commented 7 months ago

I think use custom ImageProvider with flutter_cache_manager might fix it. It's not easy to reproduce.

The same as Image.file, it's better to provide a runnable demo to reproduce it

The file bytes are cached in memory as Image.file do, so i don't think your problem is about it. i can't do anything if i can't reproduct it.