Mi 10T Lite cache for Pictures

Search This thread

Bernie_W

Senior Member
Jan 23, 2016
212
104
I discovered something, maybe someone is interested, so I'll write it briefly.



If you take a picture with the camera (whatever else, right) and then look at it in the gallery, it is cached as a preview. If you delete it, it is gone in the gallery and if you then empty the trash, it is not saved anywhere (is temporarily saved in /storage/emulated/0/MIUI/Gallery/cloud/.trahsbin). Nothing new so far.


But: if you look under /storage/emulated/0/Android/data/com.miui.gallery/gallery_disk_cache/full_size or small_size, you can still see the smaller pictures, so to speak the small preview pictures in the gallery (you can rename the .0 to .jpg). Even the oldest ones that have been made and deleted long time ago were there, just smaller (less than 1MB), but they are there and take up memory. Even a restart does not delete them. I don't know if there is any limit and if it will not be erased at some point. Otherwise it is just a kind of second backup or the memory will run out at some point in the case of frequent photographers or video takers. The security tool did not remove them when you tried to use the cleaner tool. At least in my case it didn't.
 

_mysiak_

Senior Member
Apr 1, 2009
2,476
1,485
Xiaomi Mi 10T Lite
That's unfortunately quite standard way for many apps which cache picture files for faster viewing, previews mostly will not get deleted automatically. App can store such previews as cache or app data, so to remove previews you need to clean corresponding category. For MIUI gallery it would be app data.

If you are concerned about storage use, clean data every now and then. If you are concerned about security - don't use your phone to take sensitive pictures. 🙂
 
  • Like
Reactions: Frxhb and Bernie_W

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,052
London
That's unfortunately quite standard way for many apps which cache picture files for faster viewing, previews mostly will not get deleted automatically. App can store such previews as cache or app data, so to remove previews you need to clean corresponding category. For MIUI gallery it would be app data.

If you are concerned about storage use, clean data every now and then. If you are concerned about security - don't use your phone to take sensitive pictures. 🙂
I disagree with this comment for a few reasons

1- There is no option to clear data of the MIUI gallery app. It only allows you to clear cache

2 - This only effects pictures taken with the stock camera app. If you use a 3rd party camera app & a different gallery app it doesn't happen (I've checked their data folders too)

3 - Define sensitive image. In my opinion any image I take is sensitive if I don't intend to share it with anyone regardless of what the image actually is. If I delete the image it should be deleted & not stored in data of the stock gallery apps data
 
  • Like
Reactions: Bernie_W

_mysiak_

Senior Member
Apr 1, 2009
2,476
1,485
Xiaomi Mi 10T Lite
I disagree with this comment for a few reasons

1- There is no option to clear data of the MIUI gallery app. It only allows you to clear cache

2 - This only effects pictures taken with the stock camera app. If you use a 3rd party camera app & a different gallery app it doesn't happen (I've checked their data folders too)

3 - Define sensitive image. In my opinion any image I take is sensitive if I don't intend to share it with anyone regardless of what the image actually is. If I delete the image it should be deleted & not stored in data of the stock gallery apps data
1. you are right, but with root access it can be done easily directly or through another app. I suppose that "MIUI optimizations" are blocking "clean data" button.

2. it happens with Simple gallery app, Total commander, Quickpic,.. Some apps store data in cache, others store them as app data. It doesn't matter if you use stock or 3rd party camera app. As soon as you open MIUI gallery or another gallery app (or allow them to be always running and scanning storage for new pictures), it generates a preview and keeps it for a future use.

3. yes I agree, but you unfortunately can't rely on this assumption. Any app with access to storage area should be considered as a source of potential data leak.

I am not defending MIUI apps (I avoid them like plague), just wanted to highlight that it's not the only app with such issue.
 
  • Like
Reactions: Bernie_W

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,052
London
1. you are right, but with root access it can be done easily directly or through another app. I suppose that "MIUI optimizations" are blocking "clean data" button.

2. it happens with Simple gallery app, Total commander, Quickpic,.. Some apps store data in cache, others store them as app data. It doesn't matter if you use stock or 3rd party camera app. As soon as you open MIUI gallery or another gallery app (or allow them to be always running and scanning storage for new pictures), it generates a preview and keeps it for a future use.

3. yes I agree, but you unfortunately can't rely on this assumption. Any app with access to storage area should be considered as a source of potential data leak.

I am not defending MIUI apps (I avoid them like plague), just wanted to highlight that it's not the only app with such issue.
Storing them in cache is fine as the cache can be deleted - I've checked simple gallery app and it doesn't store anything permanently in data.

What I have an issue with is the permanent storage of these files in data. If they are temp files they should be stored as cache which is deleted when you clear the cache.

I agree that anything stored could be leaked however if you delete a file it should be deleted and not leave temp files behind that cannot be removed through clearing cache (by deleted I mean deleted at user level & not deleted beyond some forensic recovery tool)

Using open camera and simple gallery app no such files are left behind permanently in data
 

Bernie_W

Senior Member
Jan 23, 2016
212
104
Thanks for cross-checking this. I think both of your comments are right. Many apps are keeping this cached data, but I also would like to see a possibility to clean this data for privacy reasons. The question what is considered to be sensitive is manyfold of course. I sometimes take a picture of a postal document to store it on my PC, but would also consider family pictures as private.

For me - in a good sense - it looks like a simple bug, that the authors of the SW didn't check this. In a more bad sense, but I haven't tried that (and will not ;)) is that this cache is possibly transferred to Xiaomi if you use a Mi-account on your device. Who knows. Just remembering the old story with this Mi-browser......
Therefore I shared, as it may fill your device storage over time, which was my main concern.
 
  • Like
Reactions: _mysiak_

_mysiak_

Senior Member
Apr 1, 2009
2,476
1,485
Xiaomi Mi 10T Lite
Thanks for sharing, I didn't want to discourage you or dismiss this issue as irrelevant. MIUI gallery should certainly store such data in cache folder and/or delete the preview after removal of the source picture. I am going to delete all data and disable the app through ADB, I used it only once to test the sky replacement feature anyway and now I have a good reason to disable it again. :)

Edit: with disabled MIUI gallery, after taking the screenshot it doesn't show the usual edit window, it saves the picture right away. Just in case if anyone wondered about the impact. :)
 
Last edited:
  • Like
Reactions: Bernie_W

TheFixItMan

Senior Member
Jul 8, 2012
7,844
4,052
London
Thanks for sharing, I didn't want to discourage you or dismiss this issue as irrelevant. MIUI gallery should certainly store such data in cache folder and/or delete the preview after removal of the source picture. I am going to delete all data and disable the app through ADB, I used it only once to test the sky replacement feature anyway and now I have a good reason to disable it again. :)

Edit: with disabled MIUI gallery, after taking the screenshot it doesn't show the usual edit window, it saves the picture right away. Just in case if anyone wondered about the impact. :)
You can also revoke the storage permissions for the MIUI gallery app - you keep the screenshot edit window but as it doesn't have permissions to access storage it can't save the preview files to data
 
  • Like
Reactions: Bernie_W

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I discovered something, maybe someone is interested, so I'll write it briefly.



    If you take a picture with the camera (whatever else, right) and then look at it in the gallery, it is cached as a preview. If you delete it, it is gone in the gallery and if you then empty the trash, it is not saved anywhere (is temporarily saved in /storage/emulated/0/MIUI/Gallery/cloud/.trahsbin). Nothing new so far.


    But: if you look under /storage/emulated/0/Android/data/com.miui.gallery/gallery_disk_cache/full_size or small_size, you can still see the smaller pictures, so to speak the small preview pictures in the gallery (you can rename the .0 to .jpg). Even the oldest ones that have been made and deleted long time ago were there, just smaller (less than 1MB), but they are there and take up memory. Even a restart does not delete them. I don't know if there is any limit and if it will not be erased at some point. Otherwise it is just a kind of second backup or the memory will run out at some point in the case of frequent photographers or video takers. The security tool did not remove them when you tried to use the cleaner tool. At least in my case it didn't.
    2
    That's unfortunately quite standard way for many apps which cache picture files for faster viewing, previews mostly will not get deleted automatically. App can store such previews as cache or app data, so to remove previews you need to clean corresponding category. For MIUI gallery it would be app data.

    If you are concerned about storage use, clean data every now and then. If you are concerned about security - don't use your phone to take sensitive pictures. 🙂
    2
    1. you are right, but with root access it can be done easily directly or through another app. I suppose that "MIUI optimizations" are blocking "clean data" button.

    2. it happens with Simple gallery app, Total commander, Quickpic,.. Some apps store data in cache, others store them as app data. It doesn't matter if you use stock or 3rd party camera app. As soon as you open MIUI gallery or another gallery app (or allow them to be always running and scanning storage for new pictures), it generates a preview and keeps it for a future use.

    3. yes I agree, but you unfortunately can't rely on this assumption. Any app with access to storage area should be considered as a source of potential data leak.

    I am not defending MIUI apps (I avoid them like plague), just wanted to highlight that it's not the only app with such issue.
    Storing them in cache is fine as the cache can be deleted - I've checked simple gallery app and it doesn't store anything permanently in data.

    What I have an issue with is the permanent storage of these files in data. If they are temp files they should be stored as cache which is deleted when you clear the cache.

    I agree that anything stored could be leaked however if you delete a file it should be deleted and not leave temp files behind that cannot be removed through clearing cache (by deleted I mean deleted at user level & not deleted beyond some forensic recovery tool)

    Using open camera and simple gallery app no such files are left behind permanently in data
    1
    I've just looked and yes they are all there - This is a huge security issue in my opinion
    1
    That's unfortunately quite standard way for many apps which cache picture files for faster viewing, previews mostly will not get deleted automatically. App can store such previews as cache or app data, so to remove previews you need to clean corresponding category. For MIUI gallery it would be app data.

    If you are concerned about storage use, clean data every now and then. If you are concerned about security - don't use your phone to take sensitive pictures. 🙂
    I disagree with this comment for a few reasons

    1- There is no option to clear data of the MIUI gallery app. It only allows you to clear cache

    2 - This only effects pictures taken with the stock camera app. If you use a 3rd party camera app & a different gallery app it doesn't happen (I've checked their data folders too)

    3 - Define sensitive image. In my opinion any image I take is sensitive if I don't intend to share it with anyone regardless of what the image actually is. If I delete the image it should be deleted & not stored in data of the stock gallery apps data