Fix thumbnail_img NoneType error (#2941)
### What problem does this PR solve? fix thumbnail_img NoneType error ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
1a623df849
commit
6a4858a7ee
1 changed files with 5 additions and 2 deletions
|
|
@ -199,8 +199,11 @@ def thumbnail_img(filename, blob):
|
||||||
|
|
||||||
def thumbnail(filename, blob):
|
def thumbnail(filename, blob):
|
||||||
img = thumbnail_img(filename, blob)
|
img = thumbnail_img(filename, blob)
|
||||||
return IMG_BASE64_PREFIX + \
|
if img is not None:
|
||||||
base64.b64encode(img).decode("utf-8")
|
return IMG_BASE64_PREFIX + \
|
||||||
|
base64.b64encode(img).decode("utf-8")
|
||||||
|
else:
|
||||||
|
return ''
|
||||||
|
|
||||||
def traversal_files(base):
|
def traversal_files(base):
|
||||||
for root, ds, fs in os.walk(base):
|
for root, ds, fs in os.walk(base):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue