From 7d885e66d33d1ddfa2d316d686598185d98b415a Mon Sep 17 00:00:00 2001 From: SbrowneA Date: Wed, 14 Apr 2021 12:01:21 +0930 Subject: [PATCH] Added ability to upload file directly instead of from path used when only the file is available (i.e. form file uploads) --- imgurpython/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgurpython/client.py b/imgurpython/client.py index 9c41ea6..de4ce5c 100644 --- a/imgurpython/client.py +++ b/imgurpython/client.py @@ -583,6 +583,9 @@ def upload_from_path(self, path, config=None, anon=True): with open(path, 'rb') as fd: self.upload(fd, config, anon) + def upload_from_image(self, image, config=None, anon=True): + return self.upload(image, config, anon) + def upload(self, fd, config=None, anon=True): if not config: config = dict()