MauiKit Image Tools

modules/metadata/exiv2extractor.h
1// SPDX-License-Identifier: LGPL-3.0-or-later
2
3/*
4 Copyright (C) 2012-15 Vishesh Handa <vhanda@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19*/
20
21#ifndef EXIV2EXTRACTOR_H
22#define EXIV2EXTRACTOR_H
23
24#include <exiv2/exiv2.hpp>
25
26#include <QString>
27#include <QVariant>
28#include <QUrl>
29
30#include "imagetools_export.h"
31
33typedef QPair<double, double> Coordinates;
34
35class City;
36class IMAGETOOLS_EXPORT Exiv2Extractor : public QObject
37{
38public:
39 Exiv2Extractor(const QUrl &url, QObject * parent = nullptr);
40 explicit Exiv2Extractor(QObject * parent = nullptr);
41
42 void setUrl(const QUrl &url);
43
44 Coordinates extractGPS() const;
45
46 bool error() const;
47
48 QString getExifTagString (const char *exifTagName, bool escapeCR=true) const;
49 QByteArray getExifTagData (const char *exifTagName) const;
50 QVariant getExifTagVariant (const char *exifTagName, bool rationalAsListOfInts=true, bool escapeCR=true, int component=0) const;
51 MetaDataMap getExifTagsDataList( const QStringList & exifKeysFilter = QStringList(), bool invertSelection = false ) const;
52 QString getExifComment() const;
53
54 bool writeTag(const char *tagName, const QVariant &value);
55 bool removeTag(const char *tagName);
56
57 QString GPSString() const;
58 QString cityId() const;
59 City *city() const;
60
61private:
62 double fetchGpsDouble(const char *name) const;
63
64 bool m_error;
65
66 QUrl m_url;
67
68 #if EXIV2_TEST_VERSION(0, 27, 99)
69 Exiv2::Image::UniquePtr m_image;
70 #else
71 Exiv2::Image::AutoPtr m_image;
72 #endif
73
74 Exiv2::ExifData & exifData() const;
75};
76
77#endif // EXIV2EXTRACTOR_H
A class for representing the GPS coordinates and information of a city.
Image metadata extractor.
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
void removeTag(Elem &elem, TagKey key)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.