Commit b1027366 authored by 's avatar

Merged fix for bug 1374 from 2.2 branch

parent 519627ca
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Image object""" """Image object"""
__version__='$Revision: 1.107 $'[11:-2] __version__='$Revision: 1.108 $'[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
...@@ -282,14 +282,14 @@ class File(Persistent,Implicit,PropertyManager, ...@@ -282,14 +282,14 @@ class File(Persistent,Implicit,PropertyManager,
def _read_data(self, file): def _read_data(self, file):
n=1<<16 n=1 << 16
if type(file) is StringType: if type(file) is StringType:
size=len(file) size=len(file)
if size < n: return file, size if size < n: return file, size
return Pdata(file), size return Pdata(file), size
if file.__class__ is Pdata: if hasattr(file, '__class__') and file.__class__ is Pdata:
size=len(file) size=len(file)
return file, size return file, size
......
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