Skip to content
Permalink
Browse files

Make QgsExifTools QML friendly

  • Loading branch information
nirvn committed Feb 8, 2020
1 parent 577e721 commit 3c64bbdcf9e42a314cff2e99daf078af2b1b8c60
@@ -8,6 +8,7 @@




class QgsExifTools
{
%Docstring
@@ -19,6 +20,9 @@ Contains utilities for working with EXIF tags in images.
%TypeHeaderCode
#include "qgsexiftools.h"
%End
public:
static const QMetaObject staticMetaObject;

public:


@@ -32,6 +36,13 @@ If the image contains an elevation tag then the returned point will contain
the elevation as a z value.

.. seealso:: :py:func:`geoTagImage`
%End

static bool hasGeoTag( const QString &imagePath );
%Docstring
Returns ``True`` if the image at ``imagePath`` contains a valid geotag.

.. seealso:: :py:func:`getGeoTag`
%End

class GeoTagDetails
@@ -100,6 +100,13 @@ QString doubleToExifCoordinate( const double val )
return QStringLiteral( "%1/1 %2/1 %3/1000" ).arg( degrees ).arg( minutes ).arg( seconds );
}

bool QgsExifTools::hasGeoTag( const QString &imagePath )
{
bool ok = false;
QgsExifTools::getGeoTag( imagePath, ok );
return ok;
}

QgsPoint QgsExifTools::getGeoTag( const QString &imagePath, bool &ok )
{
ok = false;
@@ -18,6 +18,8 @@

#include "qgis_analysis.h"
#include "qgspointxy.h"

#include <QObject>
#include <QString>
#include <QVariant>
#include <QVariantMap>
@@ -29,6 +31,8 @@
*/
class ANALYSIS_EXPORT QgsExifTools
{
Q_GADGET

public:

#if 0
@@ -47,6 +51,13 @@ class ANALYSIS_EXPORT QgsExifTools
*/
static QgsPoint getGeoTag( const QString &imagePath, bool &ok SIP_OUT );

/**
* Returns TRUE if the image at \a imagePath contains a valid geotag.
*
* \see getGeoTag()
*/
Q_INVOKABLE static bool hasGeoTag( const QString &imagePath );

/**
* Extended image geotag details.
* \ingroup analysis

0 comments on commit 3c64bbd

Please sign in to comment.
You can’t perform that action at this time.