mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive pictures: save thumbnails to individual files
The old code loaded all thumbnails into memory at once. This does not scale to logs with thousands of pictures. Therefore, save the pictures to individual files and only load the currently needed pictures. Currently, this will make changing switching between dives slower, because the thumbnails are loaded from disk. In the future, it is planned to do this in a background thread without blocking the user interface. A notable difference to the old code: Thumbnails are now indexed by the image-hash (i.e. the content of the raw image) and not by the filename of the image. Thus, different paths to the same image should only be saved once. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c0bca3ad04
commit
6618c9ebfc
3 changed files with 66 additions and 9 deletions
|
|
@ -30,6 +30,7 @@ void write_hashes();
|
|||
void updateHash(struct picture *picture);
|
||||
QByteArray hashFile(const QString &filename);
|
||||
QString hashString(const char *filename);
|
||||
QString thumbnailFileName(const QString &filename);
|
||||
void learnImages(const QDir dir, int max_recursions);
|
||||
void add_hash(const QString &filename, const QByteArray &hash);
|
||||
void hashPicture(struct picture *picture);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue