Skip to content

Commit

Permalink
closing #83
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko Hellsing committed Feb 5, 2012
1 parent 3d98849 commit f446f91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sorl/thumbnail/engines/convert_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def write(self, image, options, thumbnail):
args = map(smart_str, args)
p = Popen(args)
p.wait()
with open(out, 'r') as fp:
with open(out, 'rb') as fp:
thumbnail.write(fp.read())
os.close(handle)
os.remove(out)
Expand All @@ -49,7 +49,7 @@ def get_image(self, source):
Returns the backend image objects from a ImageFile instance
"""
handle, tmp = mkstemp()
with open(tmp, 'w') as fp:
with open(tmp, 'wb') as fp:
fp.write(source.read())
os.close(handle)
return {'source': tmp, 'options': SortedDict(), 'size': None}
Expand All @@ -73,7 +73,7 @@ def is_valid_image(self, raw_data):
valid that it can use as input.
"""
handle, tmp = mkstemp()
with open(tmp, 'w') as fp:
with open(tmp, 'wb') as fp:
fp.write(raw_data)
fp.flush()
args = settings.THUMBNAIL_IDENTIFY.split(' ')
Expand Down

0 comments on commit f446f91

Please sign in to comment.