Class: QgsExifTools¶
Contains utilities for working with EXIF tags in images.
Added in version 3.6.
Static Methods
Writes geotags to the image at imagePath. |
|
Returns the geotagged coordinate stored in the image at imagePath. |
|
Returns |
|
Returns the value of of an exif tag key stored in the image at imagePath. |
|
Returns a map object containing all exif tags stored in the image at imagePath. |
|
Writes a tag to the image at imagePath. |
- class qgis.analysis.QgsExifTools¶
Bases:
object- class GeoTagDetails¶
Bases:
objectExtended image geotag details.
Added in version 3.6.
- elevation¶
GPS elevation, or NaN if elevation is not available.
- static geoTagImage(imagePath: str | None, location: QgsPointXY, details: QgsExifTools.GeoTagDetails = QgsExifTools.GeoTagDetails()) bool¶
Writes geotags to the image at
imagePath.The
locationargument indicates the GPS location to write to the image, as a WGS84 latitude/longitude coordinate.If desired, extended GPS tags (such as elevation) can be specified via the
detailsargument.Returns
Trueif writing was successful.See also
- Parameters:
imagePath (Optional[str])
location (QgsPointXY)
details (QgsExifTools.GeoTagDetails = QgsExifTools.GeoTagDetails())
- Return type:
bool
- static getGeoTag(imagePath: str | None)¶
Returns the geotagged coordinate stored in the image at
imagePath.If a geotag was found,
okwill be set toTrue.If the image contains an elevation tag then the returned point will contain the elevation as a z value.
See also
- Parameters:
imagePath (Optional[str]) -> (QgsPoint)
- static hasGeoTag(imagePath: str | None) bool¶
Returns
Trueif the image atimagePathcontains a valid geotag.See also
- Parameters:
imagePath (Optional[str])
- Return type:
bool
- static readTag(imagePath: str | None, key: str | None) Any¶
Returns the value of of an exif tag
keystored in the image atimagePath.Added in version 3.22.
- Parameters:
imagePath (Optional[str])
key (Optional[str])
- Return type:
Any
- static readTags(imagePath: str | None) Dict[str, Any]¶
Returns a map object containing all exif tags stored in the image at
imagePath.Added in version 3.22.
- Parameters:
imagePath (Optional[str])
- Return type:
Dict[str, Any]
- static tagImage(imagePath: str | None, tag: str | None, value: Any) bool¶
Writes a tag to the image at imagePath.
- Parameters:
imagePath (Optional[str]) – the image path
tag (Optional[str]) – the exif tag name
value (Any) – the exif tag value
- Return type:
bool
- Returns:
Trueif writing was successful.
Added in version 3.30.