mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
08962cb38d
commit
0646b41275
5 changed files with 80 additions and 34 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue