|
@@ -270,7 +270,7 @@ def file_prepare_v2(name, name_hash,text_content,image_urls):
|
|
|
for imgu in image_urls:
|
|
|
if get_url_type(imgu) =='video/mp4':
|
|
|
r=requests.get(imgu)
|
|
|
- f=open(dir_photo+name_hash+"/"+str(img_num)+".mp4",'wb');
|
|
|
+ f=open(dir_photo+name_hash+"/"+str(img_num)+".mp4",'wb')
|
|
|
for chunk in r.iter_content(chunk_size=255):
|
|
|
if chunk:
|
|
|
f.write(chunk)
|
|
@@ -300,7 +300,7 @@ def file_prepare_v2(name, name_hash,text_content,image_urls):
|
|
|
|
|
|
def txt2image(content, save_target):
|
|
|
unicode_text = content
|
|
|
- font = ImageFont.truetype("caption_font.ttf", 20,encoding='utf-8')
|
|
|
+ font = ImageFont.truetype("caption_font.ttf", 20,encoding='big5')
|
|
|
text_width, text_height = font.getsize(unicode_text)
|
|
|
canvas = Image.new('RGBA', (500, 500), (255, 0, 0, 0) )
|
|
|
draw = ImageDraw.Draw(canvas)
|