Dive pictures: find moved pictures based on filename

Users might have edited their pictures. Therefore, instead of identifying
pictures by the hash of the file-content, use the file path. The match
between original and new filename is graded by a score. Currently, this
is the number of path components that match, starting from the filename.
Camparison is case-insensitive.

After having identified the matching images, write the caches so that they
are saved even if the user doesn't cleanly quit the application.

Since the new code uses significantly less resources, it can be run in a
single background thread. Thus, the multi-threading can be simplified.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-06-03 17:26:44 +02:00 committed by Dirk Hohndel
parent 08962cb38d
commit 0646b41275
5 changed files with 80 additions and 34 deletions

View file

@ -31,7 +31,7 @@ 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 learnImages(const QStringList &dirNames, int max_recursions);
void learnPictureFilename(const QString &originalName, const QString &localName);
void hashPicture(QString filename);
extern "C" char *hashstring(const char *filename);