Skip to content

Commit

Permalink
Make QgsExifTools QML friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 9, 2020
1 parent 577e721 commit 3c64bbd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/analysis/auto_generated/raster/qgsexiftools.sip.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@







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

public: public:




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


.. seealso:: :py:func:`geoTagImage` .. 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 %End


class GeoTagDetails class GeoTagDetails
Expand Down
7 changes: 7 additions & 0 deletions src/analysis/raster/qgsexiftools.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ QString doubleToExifCoordinate( const double val )
return QStringLiteral( "%1/1 %2/1 %3/1000" ).arg( degrees ).arg( minutes ).arg( seconds ); 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 ) QgsPoint QgsExifTools::getGeoTag( const QString &imagePath, bool &ok )
{ {
ok = false; ok = false;
Expand Down
11 changes: 11 additions & 0 deletions src/analysis/raster/qgsexiftools.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@


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

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

public: public:


#if 0 #if 0
Expand All @@ -47,6 +51,13 @@ class ANALYSIS_EXPORT QgsExifTools
*/ */
static QgsPoint getGeoTag( const QString &imagePath, bool &ok SIP_OUT ); 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. * Extended image geotag details.
* \ingroup analysis * \ingroup analysis
Expand Down

0 comments on commit 3c64bbd

Please sign in to comment.