Commit 2cc462e7 authored by 's avatar

Fixed a bug that caused very small images not to be stored correctly

parent bf20e71b
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Image object""" """Image object"""
__version__='$Revision: 1.77 $'[11:-2] __version__='$Revision: 1.78 $'[11:-2]
import Globals, string, struct, content_types import Globals, string, struct, content_types
from OFS.content_types import guess_content_type from OFS.content_types import guess_content_type
...@@ -268,7 +268,8 @@ class File(Persistent,Implicit,PropertyManager, ...@@ -268,7 +268,8 @@ class File(Persistent,Implicit,PropertyManager,
jar=self._p_jar jar=self._p_jar
if size <= 2*n or jar is None or Globals.DatabaseVersion=='2': if size <= 2*n or jar is None or Globals.DatabaseVersion=='2':
seek(0) seek(0)
if size < n: read(size), size if size < n:
return read(size), size
return Pdata(read(size)), size return Pdata(read(size)), size
# Now we're going to build a linked list from back # Now we're going to build a linked list from back
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment