def load_image(name): if os.path.isfile(name): width, height = imload.QueryImage(name) im = ImageRGBA(width, height) addr, pitch = im.get_addr() imload.GetImage(name, addr, width, height) return im return None
def _windows_image_loader(fname): try: import imload width, height = imload.QueryImage(fname) im = ImageRGBA(width, height) addr, pitch = im.address_info() imload.GetImage(fname, addr, width, height) return im except ImportError: return None return None