Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,12 +15,12 @@ def capture_image(image,username,userid, format):
|
|
| 15 |
filename = userid + ".png"
|
| 16 |
new_width, new_height = 354, 472
|
| 17 |
resized_image = cv2.resize(image_array, (new_width, new_height), interpolation=cv2.INTER_LINEAR)
|
| 18 |
-
cv2.imwrite(filename,
|
| 19 |
else:
|
| 20 |
filename = userid + ".jpg"
|
| 21 |
new_width, new_height = 354, 472
|
| 22 |
resized_image = cv2.resize(image_array, (new_width, new_height), interpolation=cv2.INTER_LINEAR)
|
| 23 |
-
cv2.imwrite(filename,
|
| 24 |
|
| 25 |
|
| 26 |
# base64 encode
|
|
|
|
| 15 |
filename = userid + ".png"
|
| 16 |
new_width, new_height = 354, 472
|
| 17 |
resized_image = cv2.resize(image_array, (new_width, new_height), interpolation=cv2.INTER_LINEAR)
|
| 18 |
+
cv2.imwrite(filename, resized_image, [int(cv2.IMWRITE_PNG_COMPRESSION), 9])
|
| 19 |
else:
|
| 20 |
filename = userid + ".jpg"
|
| 21 |
new_width, new_height = 354, 472
|
| 22 |
resized_image = cv2.resize(image_array, (new_width, new_height), interpolation=cv2.INTER_LINEAR)
|
| 23 |
+
cv2.imwrite(filename, resized_image, [int(cv2.IMWRITE_JPEG_QUALITY), 90])
|
| 24 |
|
| 25 |
|
| 26 |
# base64 encode
|