Skip to content

Commit

Permalink
Merge pull request #105 from WonderfulLife/fix-zero-bytes-remaining
Browse files Browse the repository at this point in the history
Reset image stream position after using `.tell()`
  • Loading branch information
xenatisch authored Feb 24, 2018
2 parents 3782794 + 010c8ee commit af8f17e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion markdownx/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Python internal library.
from os import path, SEEK_END
from os import path, SEEK_END, SEEK_SET
from uuid import uuid4
from collections import namedtuple

Expand Down Expand Up @@ -63,6 +63,7 @@ def save(self, commit=True):
# may be stored as uploaded.
image = self._process_raster(image, image_extension)
image_size = image.tell()
image.seek(0, SEEK_SET)

# Processed file (or the actual file in the case of SVG) is now
# saved in the memory as a Django object.
Expand Down

0 comments on commit af8f17e

Please sign in to comment.