签名图片优化
This commit is contained in:
parent
850817c04e
commit
152996430a
|
@ -60,8 +60,8 @@ class GenSignature(APIView):
|
||||||
image[i][j][0],image[i][j][1],image[i][j][2] = 0,0,0
|
image[i][j][0],image[i][j][1],image[i][j][2] = 0,0,0
|
||||||
ext = os.path.splitext(path)
|
ext = os.path.splitext(path)
|
||||||
new_path = ext[0] + '.png'
|
new_path = ext[0] + '.png'
|
||||||
cv2.imwrite(new_path,image)
|
cv2.imwrite(new_path, image)
|
||||||
return Response({'path':new_path}, status=status.HTTP_200_OK)
|
return Response({'path':new_path.replace(BASE_DIR, '')}, status=status.HTTP_200_OK)
|
||||||
except:
|
except:
|
||||||
return Response('签名照处理失败,请重新上传',
|
return Response('签名照处理失败,请重新上传',
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
Loading…
Reference in New Issue