Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, width, height, fname):
fname = os.path.join(CONFIG['image.file_path'], fname)
_, fmt = os.path.splitext(fname)
fmt = fmt.lower()[1:]
with open(fname, 'rb') as fid:
img = _transform.ImageElement(fid, width, height, fmt)
self.root = img.root