Skip to content

Commit c45391d

Browse files
committed
BF: Use newer call to frombytes, replacing fromstring.
1 parent 64333e6 commit c45391d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/dft.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def as_png(self, index=None, scale_to_slice=True):
138138
max = data.max()
139139
data = data * 255 / (max - min)
140140
data = data.astype(numpy.uint8)
141-
im = PIL.Image.fromstring('L', (self.rows, self.columns),
142-
data.tostring())
141+
im = PIL.Image.frombytes('L', (self.rows, self.columns),
142+
data.tobytes())
143143
s = BytesIO()
144144
im.save(s, 'PNG')
145145
return s.getvalue()

0 commit comments

Comments
 (0)