def __init__(self, *args, **kwargs): """ Register PNG with pymaging. """ registry.formats = [] registry.names = {} registry._populate() registry.register(PNG) super(PymagingImage, self).__init__(*args, **kwargs)
def setup_pymaging(context): registry._populate() context['old_registry'] = (registry.formats, registry.names) registry.formats = [] registry.names = {} registry.register(PNG)