def insert(self, file_id, file_path):
img = Image.open(file_path)
w = int(img.width / 2)
h = int(img.height / 2)
img_resize = img.resize((w, h))
img_resize.save('./temp.png')
with open('./temp.png', 'rb') as fh:
bindata = fh.read()
buf = '0x' + binascii.hexlify(bindata).decode('ascii')
query = f"INSERT INTO {self.tablename}(FILE_ID, FILE_DATA) VALUES ({file_id}, {buf})"
self.cursor.execute(query)
self.conn.commit()
2022년 7월 26일 화요일
mssql insert image
피드 구독하기:
댓글 (Atom)
docker redmine 설치
docker-composer.yml version: '3.1' services: redmine: image: redmine restart: always container_na...
-
docker-composer.yml version: '3.1' services: redmine: image: redmine restart: always container_na...
-
출처] https://herohjk.com/41 import os from PIL import Image from reportlab.pdfgen.canvas import Canvas from PyPDF2 import PdfReader, PdfWrite...
-
sudo apt install vim php 파일 업로드 설정 확인 sudo vim /etc/php/7.4/apache2/php.ini file_uploads = On upload_max_filesize = 20M MediaWiki 파일 저장 폴더 소...
댓글 없음:
댓글 쓰기