7 Commits

Author SHA1 Message Date
b313b15686 Test fix nft_svc
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
2022-05-08 01:11:56 +07:00
aacb413176 Some fix
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 01:06:05 +07:00
efc711cd3b Added jpeg to png converted images
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 01:02:04 +07:00
b77f1bc13d Remove jpeg's
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 00:49:08 +07:00
55f17606d6 Merge branch 'main' of https://gitea.gavt45.ru/gav/es-bot
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 00:44:41 +07:00
e0c9aad35a Update pictures 2022-05-08 00:44:19 +07:00
gav
8c558f7bc0 Merge pull request 'Job of fucking copywriter!!!' (#4) from text-edition into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
Reviewed-by: gav <a@a.aa>
2022-05-05 12:13:54 +07:00
346 changed files with 271 additions and 771 deletions

View File

@ -16,7 +16,7 @@ def open_image_as_array(path):
def get_encoded_img(arr): def get_encoded_img(arr):
img = Image.fromarray(arr).convert("L") img = Image.fromarray(arr)
img_byte_arr = io.BytesIO() img_byte_arr = io.BytesIO()
img.save(img_byte_arr, format='PNG') img.save(img_byte_arr, format='PNG')
encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii') encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii')
@ -26,13 +26,14 @@ def get_encoded_img(arr):
@app.route('/getImage', methods=['GET']) @app.route('/getImage', methods=['GET'])
def get_image(): def get_image():
# print(random.choice(os.listdir(IMAGE_PATH))) # print(random.choice(os.listdir(IMAGE_PATH)))
image = mpimg.imread(os.path.join(IMAGE_PATH, random.choice(os.listdir(IMAGE_PATH)))) file = os.path.join(IMAGE_PATH, random.choice(os.listdir(IMAGE_PATH)))
# buffered = io.BytesIO() # buffered = io.BytesIO()
# image.save(buffered, format="JPEG") # image.save(buffered, format="JPEG")
# img_str = base64.b64encode(buffered.getvalue()) # img_str = base64.b64encode(buffered.getvalue())
image = base64.encodebytes(open(file, 'rb').read()).decode('ascii')
return jsonify({ return jsonify({
"code": 0, "code": 0,
"image": get_encoded_img(image), "image": image,
"first_time": 1 "first_time": 1
}) })

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
nft_svc/pics/pic_0.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_1.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_10.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_100.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_101.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_102.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_103.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_104.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_105.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_106.jpg (Stored with Git LFS)

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More