How to use the pyexiv2.lib.exiv2api function in pyexiv2

To help you get started, we’ve selected a few pyexiv2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LeoHsiao1 / pyexiv2 / pyexiv2 / core.py View on Github external
def set_log_level(level=2):
    """
    Set the level of handling logs. There are five levels of handling logs:
        0 : debug
        1 : info
        2 : warn
        3 : error
        4 : mute
    """
    if level in [0, 1, 2, 3, 4]:
        api.set_log_level(level)
    else:
        raise ValueError('Invalid log level.')


api.init()
set_log_level(2)
github LeoHsiao1 / pyexiv2 / pyexiv2 / core.py View on Github external
def __init__(self, filename, encoding='utf-8'):
        """ Open an image and load its metadata. """
        self.img = api.open_image(filename.encode(encoding))