mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-25 08:10:33 +03:00
Merge pull request #1730 from radarhere/frombuffer_args
Changed default frombuffer raw decoder args
This commit is contained in:
commit
f92f429317
|
@ -2592,14 +2592,7 @@ def frombuffer(mode, size, data, decoder_name="raw", *args):
|
|||
|
||||
if decoder_name == "raw":
|
||||
if args == ():
|
||||
warnings.warn(
|
||||
"the frombuffer defaults will change in Pillow 7.0.0; "
|
||||
"for portability, change the call to read:\n"
|
||||
" frombuffer(mode, size, data, 'raw', mode, 0, 1)",
|
||||
RuntimeWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
args = mode, 0, -1 # may change to (mode, 0, 1) post-1.1.6
|
||||
args = mode, 0, 1
|
||||
if args[0] in _MAPMODES:
|
||||
im = new(mode, (1, 1))
|
||||
im = im._new(core.map_buffer(data, size, decoder_name, None, 0, args))
|
||||
|
|
Loading…
Reference in New Issue
Block a user