You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defopen(fp, mode="r", formats=None):
ifmode!="r":
raiseValueError(f"bad mode {repr(mode)}")
elifisinstance(fp, io.StringIO):
raiseValueError(
"StringIO cannot be used to open an image. ""Binary data must be used instead."
)
ifformatsisNone:
formats=IDelifnotisinstance(formats, (list, tuple)):
raiseTypeError("formats must be a list or tuple")
exclusive_fp=Falsefilename=""ifisinstance(fp, Path):
filename=str(fp.resolve())
elifisPath(fp):
filename=fpiffilename:
fp=builtins.open(filename, "rb")
exclusive_fp=Truetry:
fp.seek(0)
except (AttributeError, io.UnsupportedOperation):
fp=io.BytesIO(fp.read())
exclusive_fp=Trueprefix=fp.read(16)
preinit()
accept_warnings= []
没有找到哪里有用到_open_core()。
万忙之中如有闲余时间解答不胜感激
The text was updated successfully, but these errors were encountered:
在阅读
Image.open()
的源码源码🔗
没有找到哪里有用到
_open_core()
。万忙之中如有闲余时间解答不胜感激
The text was updated successfully, but these errors were encountered: