xczczx
This commit is contained in:
parent
31ab123613
commit
2477afaf24
1 changed files with 2 additions and 1 deletions
|
@ -627,6 +627,7 @@ def thumbnail_thread(pid):
|
||||||
|
|
||||||
elif x.headers.get("Content-Type","").startswith("image/"):
|
elif x.headers.get("Content-Type","").startswith("image/"):
|
||||||
image_req=x
|
image_req=x
|
||||||
|
image = PILimage.open(BytesIO(x.content))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
db.close()
|
db.close()
|
||||||
|
@ -638,7 +639,7 @@ def thumbnail_thread(pid):
|
||||||
for chunk in image_req.iter_content(1024):
|
for chunk in image_req.iter_content(1024):
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
|
|
||||||
post.thumburl = process_image(filename=name, resize=True)
|
post.thumburl = process_image(filename=name, resize=100)
|
||||||
db.add(post)
|
db.add(post)
|
||||||
db.commit()
|
db.commit()
|
||||||
db.close()
|
db.close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue