mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-11 08:50:58 +00:00
Re-open source file on ValueError in ImageSpec.generate()
This commit is contained in:
parent
261f164127
commit
13c92db760
1 changed files with 8 additions and 1 deletions
|
|
@ -130,7 +130,14 @@ class ImageSpec(BaseImageSpec):
|
|||
|
||||
# TODO: Move into a generator base class
|
||||
# TODO: Factor out a generate_image function so you can create a generator and only override the PIL.Image creating part. (The tricky part is how to deal with original_format since generator base class won't have one.)
|
||||
img = open_image(self.source)
|
||||
try:
|
||||
img = open_image(self.source)
|
||||
except ValueError:
|
||||
|
||||
# Re-open the file -- https://code.djangoproject.com/ticket/13750
|
||||
self.source.open()
|
||||
img = open_image(self.source)
|
||||
|
||||
original_format = img.format
|
||||
|
||||
# Run the processors
|
||||
|
|
|
|||
Loading…
Reference in a new issue