mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Simplify image hashing logic
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
09c854fee0
commit
3ae6326847
2 changed files with 2 additions and 5 deletions
|
@ -1014,11 +1014,7 @@ QString fileFromHash(char *hash)
|
|||
|
||||
void updateHash(struct picture *picture) {
|
||||
QByteArray hash = hashFile(fileFromHash(picture->hash));
|
||||
QMutexLocker locker(&hashOfMutex);
|
||||
hashOf[QString(picture->filename)] = hash;
|
||||
char *old = picture->hash;
|
||||
picture->hash = strdup(hash.toHex());
|
||||
free(old);
|
||||
learnHash(picture, hash);
|
||||
}
|
||||
|
||||
void hashPicture(struct picture *picture)
|
||||
|
|
|
@ -25,6 +25,7 @@ void updateHash(struct picture *picture);
|
|||
QByteArray hashFile(const QString filename);
|
||||
void learnImages(const QDir dir, int max_recursions, bool recursed);
|
||||
void add_hash(const QString filename, QByteArray hash);
|
||||
void hashPicture(struct picture *picture);
|
||||
QString localFilePath(const QString originalFilename);
|
||||
QString fileFromHash(char *hash);
|
||||
void learnHash(struct picture *picture, QByteArray hash);
|
||||
|
|
Loading…
Add table
Reference in a new issue