diff --git a/package/__pycache__/app.cpython-37.pyc b/package/__pycache__/app.cpython-37.pyc index ab674fa..8a14ad5 100644 Binary files a/package/__pycache__/app.cpython-37.pyc and b/package/__pycache__/app.cpython-37.pyc differ diff --git a/package/__pycache__/xmp.cpython-37.pyc b/package/__pycache__/xmp.cpython-37.pyc index 7d9d411..e0639aa 100644 Binary files a/package/__pycache__/xmp.cpython-37.pyc and b/package/__pycache__/xmp.cpython-37.pyc differ diff --git a/package/app.py b/package/app.py index e94f842..649121f 100644 --- a/package/app.py +++ b/package/app.py @@ -41,8 +41,9 @@ def process_file(file_name, xmp): try: # Process the file into a JPEG - rgb = rawpy.imread(os.path.join(input_path, file_name)).postprocess() - imageio.imsave(os.path.join(temp_file_path), rgb) + rgb = rawpy.imread(os.path.join(input_path, file_name)) + imageio.imsave(os.path.join(temp_file_path), rgb.postprocess()) + rgb.close() # Information on file sizes print("Raw Size: {} {}".format(*_size(os.path.join(input_path, file_name))), end=' | ') @@ -56,6 +57,7 @@ def process_file(file_name, xmp): image = Image.open(temp_file_path) bytesIO = io.BytesIO() image.save(bytesIO, format='jpeg') + image.close() image = types.Image(content=bytesIO.getvalue()) # Performs label detection on the image file