How to use the pyexiv2.lib.exiv2api.close_image 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 close(self):
        """ Free the memory for storing image data. """
        api.close_image(self.img)
        
        # Disable all public methods
        def closed_warning():
            raise RuntimeError('Do not operate on the closed image.')
        for attr in dir(self):
            if not attr.startswith('_') and callable(getattr(self, attr)):
                setattr(self, attr, closed_warning)