QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsexiftools.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgisexiftools.h
3  ---------------
4  Date : November 2018
5  Copyright : (C) 2018 by Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSEXIFTOOLS_H
17 #define QGSEXIFTOOLS_H
18 
19 #include "qgis_core.h"
20 #include "qgspointxy.h"
21 
22 #include <QObject>
23 #include <QString>
24 #include <QVariant>
25 #include <QVariantMap>
26 
32 class CORE_EXPORT QgsExifTools
33 {
34  Q_GADGET
35 
36  public:
37 
42  static QVariantMap readTags( const QString &imagePath );
43 
48  static QVariant readTag( const QString &imagePath, const QString &key );
49 
60  static QgsPoint getGeoTag( const QString &imagePath, bool &ok SIP_OUT );
61 
67  Q_INVOKABLE static bool hasGeoTag( const QString &imagePath );
68 
74  class GeoTagDetails
75  {
76  public:
77 
79  : elevation( std::numeric_limits< double >::quiet_NaN() )
80  {
81  }
82 
86  double elevation = 0;
87  };
88 
100  static bool geoTagImage( const QString &imagePath, const QgsPointXY &location, const GeoTagDetails &details = QgsExifTools::GeoTagDetails() );
101 
102 };
103 
104 #endif // QGSEXIFTOOLS_H
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:48
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:58
QgsExifTools
Contains utilities for working with EXIF tags in images.
Definition: qgsexiftools.h:32
qgspointxy.h
QgsExifTools::GeoTagDetails
Extended image geotag details.
Definition: qgsexiftools.h:87