[Q] Where does stock HTC Gallery store database?

Search This thread

oryan_dunn

Senior Member
Dec 23, 2010
679
183
Somehow, my gallery is showing the same pictures twice. Not all, but many. If you long press, and click details, the picture name and location for the two are identical. I've verify that only one copy is on the SD card. I've tried clearing data for the gallery (via the app menu in settings); I also tried deleting /data/data/com.htc.album (which had some database files, oh, I should note I have root) as well as deleting all .thumbnail directories. I figure there must be somewhere that I'm not looking.

Here's a screenshot:
2014-06-07_00-39-43 by oryan_dunn, on Flickr
 
Last edited:

pbergonzi

Senior Member
Jun 14, 2013
1,914
703
Mesa, AZ

oryan_dunn

Senior Member
Dec 23, 2010
679
183
How about first backup all your pictures to your PC so you're sure to have them, disconnect from PC, then try delete ALL of them through Gallery.
Maybe there's a backup on your ext_sd and that's why?

Here's something web-wise that might apply (google):
http://android.stackexchange.com/questions/43311/im-seeing-duplicated-images-and-videos-on-gallery

I saw that, but I'm not on JB, and the path given in details for each image is identical. I do have a backup, I'll see what happens when I delete one of the two. As you can see, I've got several thousand pictures, so I'd rather not fix this one at a time, esp since I'm going to be flashing a new ROM soon. I just want to try to figure this out. There has to be a way to reset the gallery and get it to rescan my SD card fresh.
 

pbergonzi

Senior Member
Jun 14, 2013
1,914
703
Mesa, AZ
delete all

I saw that, but I'm not on JB, and the path given in details for each image is identical. I do have a backup, I'll see what happens when I delete one of the two. As you can see, I've got several thousand pictures, so I'd rather not fix this one at a time, esp since I'm going to be flashing a new ROM soon. I just want to try to figure this out. There has to be a way to reset the gallery and get it to rescan my SD card fresh.

In Gallery Album view then settings, I find option "Select Album" allowing me to tag each and every album to delete all at once.
However my gallery in ICS CM10 may be different than yours.
If your images are synced to the web is there a chance that they show up as the second images?
 

oryan_dunn

Senior Member
Dec 23, 2010
679
183
In Gallery Album view then settings, I find option "Select Album" allowing me to tag each and every album to delete all at once.
However my gallery in ICS CM10 may be different than yours.
If your images are synced to the web is there a chance that they show up as the second images?

Yeah, it's the stock HTC Gallery. The only option in settings are "Perfect Pics" options. There is no way to delete full albums through the gallery. They are not synced to the web. The details dialog for the images show the exact same details down to the path, filename, everything, for duplicate images.
 

oryan_dunn

Senior Member
Dec 23, 2010
679
183
I deleted one of the pictures, and just deleting one, made both disappear from the gallery. Copying back that single file, there is only one shown. So, looks like it is definitely a goof up in the gallery database. Now to just figure out where it is on the filesystem.
 

pbergonzi

Senior Member
Jun 14, 2013
1,914
703
Mesa, AZ
view

Yeah, it's the stock HTC Gallery. The only option in settings are "Perfect Pics" options. There is no way to delete full albums through the gallery. They are not synced to the web. The details dialog for the images show the exact same details down to the path, filename, everything, for duplicate images.

Up top on the left, see if you can switch that view to Album. Then check the settings about Selecting Albums.
Yours looks different from mine--mine has a text drop-down menu where you have an icon of an album.
And I was using the on-screen buttons--Home, Menu, Return, Search, when I said to use the Settings, it was the Menu button on the bottom of my phone.
 
Last edited:

oryan_dunn

Senior Member
Dec 23, 2010
679
183
Up top on the left, see if you can switch that view to Album. Then check the settings about Selecting Albums.
Yours looks different from mine--mine has a text drop-down menu where you have an icon of an album.
And I was using the on-screen buttons--Home, Menu, Return, Search, when I said to use the Settings, it was the Menu button on the bottom of my phone.

In the screen of my screenshot, menu key doesn't do anything. Up a level, at the album view, I get a settings menu, but the only options are for Perfect Pics.
 

pbergonzi

Senior Member
Jun 14, 2013
1,914
703
Mesa, AZ
delete all

In the screen of my screenshot, menu key doesn't do anything. Up a level, at the album view, I get a settings menu, but the only options are for Perfect Pics.

Can you do it through HTC Sync, or perhaps an after-market file utility--alas the File Manager that comes with CM10 allows me to wildcard search "*.jpg" and shows them all in a list, however at that point didn't allow me to select them all at once to delete all at once, just individually.
However, my images are stored in DCIM/Camera/ and I have those folders on both my int and ext sd.

Your camera settings may give you the option of where to store photos--possibly there's a "both" option, idunno.
The free app Quick Pic that I use gives me the option to select all my photos or albums at once and to delete them at once.
Maybe that is the easiest solution.
 

oryan_dunn

Senior Member
Dec 23, 2010
679
183
I really appreciate you trying to help, but I'm almost sure the issue is the database the gallery creates. I've been using ES File Explorer to try to find this database and delete it, to force the gallery to re-parse the entire filesystem. I'm positive that the database has duplicate entries for the same file. Deleting and restoring pictures external to the gallery app has no effect. Deleting the pic from the gallery causes the gallery to remove both entries in it's database, and when I add the picture back, I get only one, as I should (which effectively cleans the db for that one particular file). This database has to exist somewhere, it's just a matter of finding and deleting it.

I submitted a question to HTC support. We'll see what they say.
 

rdar_93

Senior Member
Aug 8, 2012
618
134
Maybe it's not your device.

Maybe it's just syncing to a cloud storage.

I know that my brother's girlfriend's Motorola Xoom was sending pictures directly to her Google+ account and she didn't like that. It took me a while to figure out that's what it was because we'd delete all the pictures and still they'd show up.

Maybe that's what's happening to you.
 

oryan_dunn

Senior Member
Dec 23, 2010
679
183
Up top on the left, see if you can switch that view to Album. Then check the settings about Selecting Albums.
Yours looks different from mine--mine has a text drop-down menu where you have an icon of an album.
And I was using the on-screen buttons--Home, Menu, Return, Search, when I said to use the Settings, it was the Menu button on the bottom of my phone.

Maybe it's not your device.

Maybe it's just syncing to a cloud storage.

I know that my brother's girlfriend's Motorola Xoom was sending pictures directly to her Google+ account and she didn't like that. It took me a while to figure out that's what it was because we'd delete all the pictures and still they'd show up.

Maybe that's what's happening to you.

The stock gallery isn't that smart. On the main screen, you can select to show pictures from local storage, Picassa, Flickr, etc. But these show the same path for each duplicate "/mnt/sdcard/ext_sd/DCIM/100MEDIA".
 

oryan_dunn

Senior Member
Dec 23, 2010
679
183
Why not just try "Quickpic"? Better than stock IMO.

Quickpic

I could use a different gallery, but just as an exercise, want to figure this out, since it has to be solvable. I'm going to flash a new ROM soon, so it really doesn't matter, I just want to solve this, since it seems like an easy problem (figure out where the gallery db is and delete it).
 

pbergonzi

Senior Member
Jun 14, 2013
1,914
703
Mesa, AZ
database

I could use a different gallery, but just as an exercise, want to figure this out, since it has to be solvable. I'm going to flash a new ROM soon, so it really doesn't matter, I just want to solve this, since it seems like an easy problem (figure out where the gallery db is and delete it).

Possible it doesn't keep a database, just scans each time, and is listing the same photo under two headings even though same path?
 

oryan_dunn

Senior Member
Dec 23, 2010
679
183
Possible it doesn't keep a database, just scans each time, and is listing the same photo under two headings even though same path?

It may not be a database proper, like a SQLite database, but there is definitely some sort of cache that it builds. If I add a huge directory of pictures, open the gallery, it takes a while to parse through it all. Subsequent times opening the gallery, the pictures/thumbnails are available instantly.
 

chevycowboyusa

Senior Member
Jun 9, 2009
2,288
2,935
Big Bear City, Ca
Thumbnails

It may not be a database proper, like a SQLite database, but there is definitely some sort of cache that it builds. If I add a huge directory of pictures, open the gallery, it takes a while to parse through it all. Subsequent times opening the gallery, the pictures/thumbnails are available instantly.

Thumbs are built and kept in a folder under DICM. there is most likely a process that scans the folders for pics and then makes a thumb if it doesn't already have one.

Thus there are actually two copies of pictures on your phone. One is full sized and the other is a thumb size.

You can copy all the pics off your phone to one folder on your computer, then delete all the photos from your phone and then copy them back from your computer.

If you have thousands of pics, I'd back them up anyway. dont want to lose some great pics...
 
Last edited:
  • Like
Reactions: rdar_93

oryan_dunn

Senior Member
Dec 23, 2010
679
183
Thumbs are built and kept in a folder under DICM. there is most likely a process that scans the folders for pics and then makes a thumb if it doesn't already have one.

Thus there are actually two copies of pictures on your phone. One is full sized and the other is a thumb size.

You can copy all the pics off your phone to one folder on your computer, then delete all the photos from your phone and then copy them back from your computer.

If you have thousands of pics, I'd back them up anyway. dont want to lose some great pics...

Yeah, I've tried deleting the .thumbnail folder to try to get the gallery to rescan. Say I have 1000 pics, and I add a folder of pictures with a 1000 more, the first time I open the gallery, it shows 1000, with a spinning wheel. Eventually, it'll populate with 2000 pictures. And you can tell it's creating thumbnails. If I just delete the thumbnail folder, when I open the gallery, it immediately shows 2000 pictures, but it'll slowly recreate thumbnails. That's why I think there has to be some other cache somewhere, and in my case it has duplicates in it.

As for backup, I have a Synology NAS (with 1TB RAID1 mirror) that all of my pictures are backed up to, and I use the Synology DS Photo+ app to instantly backup pictures as I take them to my NAS. Once a month, my NAS is mirrored to a 1TB USB drive.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Thumbnails

    It may not be a database proper, like a SQLite database, but there is definitely some sort of cache that it builds. If I add a huge directory of pictures, open the gallery, it takes a while to parse through it all. Subsequent times opening the gallery, the pictures/thumbnails are available instantly.

    Thumbs are built and kept in a folder under DICM. there is most likely a process that scans the folders for pics and then makes a thumb if it doesn't already have one.

    Thus there are actually two copies of pictures on your phone. One is full sized and the other is a thumb size.

    You can copy all the pics off your phone to one folder on your computer, then delete all the photos from your phone and then copy them back from your computer.

    If you have thousands of pics, I'd back them up anyway. dont want to lose some great pics...