mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-05 06:10:58 +00:00
Fixes open source file never getting closed
In a processes that generates many images, you could run into a cituation with too man files being open. This results in: IOError: [Errno 24] Too many open files
This commit is contained in:
parent
9e5ef330fa
commit
eb81b9c88c
1 changed files with 5 additions and 3 deletions
|
|
@ -153,9 +153,11 @@ class ImageSpec(BaseImageSpec):
|
|||
self.source.open()
|
||||
img = open_image(self.source)
|
||||
|
||||
return process_image(img, processors=self.processors,
|
||||
format=self.format, autoconvert=self.autoconvert,
|
||||
options=self.options)
|
||||
new_image = process_image(img, processors=self.processors,
|
||||
format=self.format, autoconvert=self.autoconvert,
|
||||
options=self.options)
|
||||
self.source.close()
|
||||
return new_image
|
||||
|
||||
|
||||
def create_spec_class(class_attrs):
|
||||
|
|
|
|||
Loading…
Reference in a new issue