cropping a random part of an image

drewes.mil at gmail.com drewes.mil at gmail.com
Wed Aug 10 06:31:45 EDT 2016


Hi Robin,

I tried to understand and run your code, and I get the Error:

"File "Rand_Crop.py", line 15, in <module>
    with Image.open(os.path.join(INPATH, file)) as im:
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__
    raise AttributeError(name)
AttributeError: __exit__"

I looked up the Image.py and don't know, why the Name could not be read out.

If i print the names of the images out, before the first "for" everything is fine, but it dosen't work after line 15.

I try to figure this out, but if someone has a hint, I would be happy!


Steffen 



More information about the Python-list mailing list