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
@ -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…
x
Reference in New Issue
Block a user