thumb no size

master
Mustafa Yontar 4 years ago
parent 4e4b253c5e
commit 960f9745ae
  1. 23
      restapi/resource.py

@ -128,17 +128,20 @@ class Resource:
if self.base64_image and value:
if self.base64_image_as_full:
file = b64encode(value.read()).decode("utf-8")
return {
"size": value.size,
"upload_date": value.gridout.upload_date,
"format": value.format,
"base64": file
}
else:
try:
file = b64encode(value.thumbnail.read()).decode("utf-8")
except:
file = b64encode(value.read()).decode("utf-8")
return {
"size": value.size,
"upload_date": value.gridout.upload_date,
"format": value.format,
"base64": file
}
file = b64encode(value.thumbnail.read()).decode("utf-8")
return {
"upload_date": value.gridout.upload_date,
"format": value.format,
"base64": file
}
else:
if value:
return {

Loading…
Cancel
Save