Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local variable 'photoshop' referenced before assignment #4

Closed
kampelmuehler opened this issue Jul 4, 2019 · 2 comments
Closed

local variable 'photoshop' referenced before assignment #4

kampelmuehler opened this issue Jul 4, 2019 · 2 comments

Comments

@kampelmuehler
Copy link

kampelmuehler commented Jul 4, 2019

Getting the following traceback

Traceback (most recent call last):
File "stylize.py", line 150, in
main()
File "stylize.py", line 117, in main
style_img = Image.open(style_path).convert('RGB')
File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/Image.py", line 2690, in open
im = _open_core(fp, filename, prefix)
File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/Image.py", line 2676, in _open_core
im = factory(fp, filename)
File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 783, in jpeg_factory
im = JpegImageFile(fp, filename)
File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/ImageFile.py", line 103, in init
self._open()
File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 373, in _open
handler(self, i)
File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 139, in APP
self.info["photoshop"] = photoshop
UnboundLocalError: local variable 'photoshop' referenced before assignment

after around 300 images have been processed.

Any thoughts?

@kampelmuehler
Copy link
Author

Ok, It's a PIL issue, that apparently doesn't occur in 5.4.1. See python-pillow/Pillow#3769.

@Hvitgar
Copy link
Member

Hvitgar commented Jul 9, 2019

Btw: It will be fixed in the upcoming PIL release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants