naturtag.metadata.image_metadata module#

class naturtag.metadata.image_metadata.ImageMetadata(image_path=None)#

Bases: object

Class for reading & writing basic image metadata

property filtered_exif: dict[str, Any]#

Get EXIF tags, excluding some verbose manufacturer tags that aren’t useful to display

Return type

dict[str, Any]

property has_sidecar#
static read_exiv2_image(path)#

Read an image with basic error handling. Note: Exiv2 RuntimeError usually means corrupted metadata. See: https://dev.exiv2.org/issues/637#note-1

Return type

Image

read_metadata()#

Read all formats of metadata from image + sidecar file

property simple_exif: dict[str, str]#

Convert all EXIF tags with list values into strings

Return type

dict[str, str]

update(new_metadata)#

Update arbitrary EXIF, IPTC, and/or XMP metadata

write(exif=True, iptc=True, xmp=True, sidecar=True)#

Write current metadata to image and sidecar