签名图片优化

This commit is contained in:
caoqianming 2022-01-27 13:41:55 +08:00
parent 850817c04e
commit 152996430a
1 changed files with 2 additions and 2 deletions

View File

@ -60,8 +60,8 @@ class GenSignature(APIView):
image[i][j][0],image[i][j][1],image[i][j][2] = 0,0,0
ext = os.path.splitext(path)
new_path = ext[0] + '.png'
cv2.imwrite(new_path,image)
return Response({'path':new_path}, status=status.HTTP_200_OK)
cv2.imwrite(new_path, image)
return Response({'path':new_path.replace(BASE_DIR, '')}, status=status.HTTP_200_OK)
except:
return Response('签名照处理失败,请重新上传',
status=status.HTTP_400_BAD_REQUEST)