[digiKam-users] [digiKam DB] Export thumbnails of faces from DB - missing link of IDs between face and thumb

t3ste at web.de t3ste at web.de
Wed Nov 2 08:35:00 GMT 2022


Hello,
I'm not sure if my request is in the KDE forum or better here, I'll try
this way too.

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
<https://github.com/cgilles/digikam-pgf-database>

Here is the SQL script:

Code:
<https://forum.kde.org/viewtopic.php?f=255&t=176358#>
    |
    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 regard


Related KDE forum topic: https://forum.kde.org/viewtopic.php?f=255&t=176358
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-users/attachments/20221102/1daaa70c/attachment.htm>


More information about the Digikam-users mailing list