This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[digiKam] export thumbnails of faces from DB

Tags: None
(comma "," separated)
teste
Registered Member
Posts
2
Karma
0
Hello,

maybe I am lucky and one of you can help me with my project.
My goal is to extract all thumbnails of the face recognition from the database. Preferably separable per person.

I was already able to export all thumbnails (faces and unfortunately the normal ones too) via SQL script and convert them to PNG.

Now I am missing the link to the registered faces/persons. ???
Unfortunately, I could not find any connection to the face database. Somehow DigiKam must know which picture ID, face ID and thumbnail ID belong together.

I am using MariaDB, after a migration from SQlite.
To convert the PGF blob files (*.bin) into PNG, I use this tool
https://github.com/cgilles/digikam-pgf-database

Here is the SQL script:
Code: Select all

DELIMITER $$
CREATE OR REPLACE PROCEDURE procedure1()
BEGIN
  DECLARE done INT DEFAULT 0;
  DECLARE file_name VARCHAR(255);
  DECLARE file_ext VARCHAR(255);
  DECLARE file_type VARCHAR(255);
  DECLARE cur CURSOR FOR SELECT id, modificationdate, orientationHint FROM thumbnails;
  DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;

  OPEN cur;

  REPEAT
    FETCH cur INTO file_name, file_ext, file_type;
    IF NOT done THEN
      SET @query = CONCAT("SELECT data FROM thumbnails WHERE id = ", file_name, " INTO DUMPFILE 'D://images//",file_name,"_",file_type,".bin'");
      PREPARE stmt FROM @query;
      EXECUTE stmt;
      DEALLOCATE PREPARE stmt;

    END IF;
  UNTIL done END REPEAT;

  CLOSE cur;
END
$$
DELIMITER ;

CALL procedure1 ();
DROP procedure procedure1;



Thx & Best regards
teste
Registered Member
Posts
2
Karma
0
I have found it. The database values are connected via the uniqueHashes. :)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]