streamlit-cropper icon indicating copy to clipboard operation
streamlit-cropper copied to clipboard

UnboundLocalError: local variable 'orig_file' referenced before assignment

Open DaloroAT opened this issue 1 year ago • 0 comments

Hello streamlit-cropper Developers!

I got the error UnboundLocalError: local variable 'orig_file' referenced before assignment with

st_cropper(Image.open(file), realtime_update=True, box_color='#0000FF', should_resize_image=False)

That's because the variable orig_file defined in a block with if should_resize_image: here but always used later even if should_resize_image is False and orig_file is not defined.

DaloroAT avatar Jan 11 '24 12:01 DaloroAT