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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - cache file size grows after use the component #36

Closed
rpslpereiragithub opened this issue Sep 9, 2020 · 5 comments
Closed

Comments

@rpslpereiragithub
Copy link

During the upgrade RN from 0.59.9 to 0.63.2 I also upgraded the amazing-cropper to the latest version.

Everything work as expected but now when I crop the picture, after use the component the cache size of my app, on android grows more than 1 MB.
This was not happening before.

On my application I take a picture, afterwards, I cropped it using your component, and at the end I delete both pictures (original photo, and cropped file) using the RNFS.unlink.
At the end on Android the cache size of my application always grows. Any idea?

On IOS everythig work as expected, no footprint.

Thanks in advance.
Rui

@MystL
Copy link

MystL commented Dec 1, 2020

I observed the same situation as well, I did the necessary housekeeping by deleting both original and cropped file but the storage grows by 1MB.

Any insights?

@rpslpereiragithub
Copy link
Author

rpslpereiragithub commented Dec 2, 2020 via email

@MystL
Copy link

MystL commented Dec 2, 2020

After some research I noticed that after every crop, there are 2 files created on the temp Data directory (but we only have access to one of that files through the croppedImageUri. The only workaround for me was to do a complete cleanup of the temp Data directory after using this component.

On Tue, Dec 1, 2020 at 5:18 AM Melvin Lee @.***> wrote: I observed the same situation as well, I did the necessary housekeeping by deleting both original and cropped file but the storage grows by 1MB. Any insights? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#36 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ543OHTSIARCOD5AUG55G3SSR4A5ANCNFSM4RCTJQGQ .
-- Rui Pedro Pereira

I see, for your case the temp data directory can be freely clean without concerns of other files that are unrelated to this process I guess?

@rpslpereiragithub
Copy link
Author

rpslpereiragithub commented Dec 2, 2020 via email

@ggunti
Copy link
Owner

ggunti commented Sep 15, 2022

@rpslpereiragithub Yes, you are right. So always remains some garbage files. Starting v0.2.2, the onDone function returns also the garbageUris as second parameter, so you have the possibility to clear the garbage uris from cache (using RNFS.unlink for example). Of course, garbageUris should not be used for anything else. It is returned just to give the possibility to clear unused uris from cache (see README file).

@ggunti ggunti closed this as completed Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants