|
@@ -116,11 +116,11 @@ def upload_post(iurl):
|
|
|
os.makedirs(sitepath)
|
|
|
# file.save(fullpath)
|
|
|
image_object = Image.open(file)
|
|
|
- image_object.save(owpath+owfname, oimgtypeName)
|
|
|
+ image_object.save(owpath+owfname)
|
|
|
if image_object.size[0] > 1000:
|
|
|
image_object.thumbnail(size=((1600, 1600)))
|
|
|
- image_object.save(wpath+wfname, 'webp')
|
|
|
- image_object.save(sitepath+wfname, 'webp')
|
|
|
+ image_object.save(wpath+wfname)
|
|
|
+ image_object.save(sitepath+wfname)
|
|
|
#file.save(os.getcwd()+ "/backstage/upload/img/"+ fname)
|
|
|
# return redirect(url_for('download_file', name=file.filename))
|
|
|
aa = {"success": 1, "file": {"url": "/backstage/upload/" +
|
|
@@ -137,8 +137,8 @@ def upload_post(iurl):
|
|
|
image_object.thumbnail(size=((1600, 1600)))
|
|
|
if not os.path.exists(wpath):
|
|
|
os.makedirs(wpath)
|
|
|
- image_object.save(wpath+wfname, 'webp')
|
|
|
- image_object.save(mdPath+wfname, 'webp')
|
|
|
+ image_object.save(wpath+wfname)
|
|
|
+ image_object.save(mdPath+wfname)
|
|
|
owfname = wfname.replace('webp', oimgtype)
|
|
|
aa = {"success": 1, "file": {"url": "/backstage/upload/" + filepath+"/img/" + wfname,
|
|
|
"width": image_object.width, "height": image_object.height}}
|
|
@@ -199,11 +199,11 @@ def get_image(iurl):
|
|
|
if not os.path.exists(sitepath):
|
|
|
os.makedirs(sitepath)
|
|
|
image_object = Image.open(requests.get(request.get_json()['url'], stream=True).raw)
|
|
|
- image_object.save(owpath+owfname, oimgtypeName)
|
|
|
+ image_object.save(owpath+owfname)
|
|
|
if image_object.size[0] > 1000:
|
|
|
image_object.thumbnail(size=((1600, 1600)))
|
|
|
- image_object.save(wpath+wfname, 'webp')
|
|
|
- image_object.save(sitepath+wfname, 'webp')
|
|
|
+ image_object.save(wpath+wfname)
|
|
|
+ image_object.save(sitepath+wfname)
|
|
|
# send_file()
|
|
|
#aa = {"success" : 1,"file": { "url" : "http://localhost:9000/backstage/upload/avatar1.jpg", } }
|
|
|
#resp = make_response(open(os.getcwd()+ "/backstage/upload/" + fname, 'br').read(), 301)
|