Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰] Duplicate Cached Files On Android - Gallery Selection #2271

Open
mattlewer opened this issue Feb 9, 2024 · 2 comments
Open

[馃悰] Duplicate Cached Files On Android - Gallery Selection #2271

mattlewer opened this issue Feb 9, 2024 · 2 comments

Comments

@mattlewer
Copy link

mattlewer commented Feb 9, 2024

Description

When selecting a single image/video from the gallery on Android, two are created in the cache folder of the app storage.

This may to be due to two calls to getAppSpecificStorageUri within the Utils.java file. The second of these is called from getOriginalFilePath which was added on V7.0.0 here 7086e95 , this is also the file that is the duplicate.

This is preventing us cleaning up left over cache files.

As shown in the below image, two file paths are created, the final log is from the React Native side, only one is fed back, but the other still exists in cache.
Screenshot 2024-02-09 at 15 47 47
Screenshot 2024-02-09 at 15 52 52

How to repeat issue and example

  • Select a single image from the gallery
  • View cache directory of app using Android Studio

Solution

Prevent multiple files being cached when only a single item was selected.

Additional Information

  • Image Picker version: 7.0.2
  • React Native version: 0.72.6
  • Platform: Android
  • Development Operating System: MacOS
  • Dev tools: Android Studio Hedgehog | 2023.1.1
@mattlewer
Copy link
Author

@Johan-dutoit Any updates on this?

@mdottavi
Copy link

mdottavi commented May 9, 2024

I got the same issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants