Spaces:
Running
Running
Update turbowarp-server/qr-converter.py
Browse files
turbowarp-server/qr-converter.py
CHANGED
|
@@ -122,14 +122,14 @@ def generate_image(prompt):
|
|
| 122 |
|
| 123 |
def resize_and_encode(img):
|
| 124 |
"""90x90にリサイズして6桁の数字列に変換(各ピクセル6桁)"""
|
| 125 |
-
img = img.resize((
|
| 126 |
#print("[INFO] Resized image to 90x90.")
|
| 127 |
|
| 128 |
encoded = ""
|
| 129 |
total_pixels = 0
|
| 130 |
|
| 131 |
-
for y in range(
|
| 132 |
-
for x in range(
|
| 133 |
pixel = img.getpixel((x, y))
|
| 134 |
# RGB値を取得(RGBAの場合はRGBのみ使用)
|
| 135 |
if len(pixel) >= 3:
|
|
|
|
| 122 |
|
| 123 |
def resize_and_encode(img):
|
| 124 |
"""90x90にリサイズして6桁の数字列に変換(各ピクセル6桁)"""
|
| 125 |
+
img = img.resize((90, 90))
|
| 126 |
#print("[INFO] Resized image to 90x90.")
|
| 127 |
|
| 128 |
encoded = ""
|
| 129 |
total_pixels = 0
|
| 130 |
|
| 131 |
+
for y in range(90):
|
| 132 |
+
for x in range(90):
|
| 133 |
pixel = img.getpixel((x, y))
|
| 134 |
# RGB値を取得(RGBAの場合はRGBのみ使用)
|
| 135 |
if len(pixel) >= 3:
|