File indexing completed on 2024-06-23 05:32:15

0001 /*
0002     SPDX-FileCopyrightText: 2022 Fushan Wen <qydwhotmail@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 #include <QRunnable>
0011 #include <QSize>
0012 
0013 struct MediaMetadata {
0014     QString title;
0015     QString author;
0016     QSize resolution;
0017 };
0018 
0019 /**
0020  * A runnable that helps find the metadata of an image or a video.
0021  */
0022 class MediaMetadataFinder : public QObject, public QRunnable
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit MediaMetadataFinder(const QString &path, QObject *parent = nullptr);
0028 
0029     void run() override;
0030 
0031 Q_SIGNALS:
0032     void metadataFound(const QString &path, const MediaMetadata &metadata);
0033 
0034 private:
0035     QString m_path;
0036 };