yaron123 commited on
Commit
12302ad
·
1 Parent(s): ce2ea41
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -176,22 +176,22 @@ def handle_generate(artist,song,genre,lyrics):
176
  draw = ImageDraw.Draw(img)
177
 
178
  rows = 1
179
- labes_distance = math.cail(1 / 3)
180
 
181
- textheight=min(math.cail( width / 10 ), math.cail( height / 5 ))
182
  font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
183
  textwidth = draw.textlength(pos_song,font)
184
- x = math.cail((width - textwidth) / 2)
185
- y = math.cail((height - math.cail(textheight * rows / 2)) / 2)
186
- y = y - math.cail(y / labes_distance)
187
  draw.text((x, y), pos_song, (255,255,255), font=font)
188
 
189
- textheight=min(math.cail( width / 12 ), math.cail( height / 6 ))
190
  font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
191
  textwidth = draw.textlength(pos_artist,font)
192
- x = math.cail((width - textwidth) / 2)
193
- y = math.cail((height - math.cail(textheight * rows / 2)) / 2)
194
- y = y + math.cail(y / labes_distance)
195
  draw.text((x, y), pos_artist, (255,255,255), font=font)
196
 
197
  name = generate_random_string(12) + ".png"
 
176
  draw = ImageDraw.Draw(img)
177
 
178
  rows = 1
179
+ labes_distance = math.ceil(1 / 3)
180
 
181
+ textheight=min(math.ceil( width / 10 ), math.ceil( height / 5 ))
182
  font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
183
  textwidth = draw.textlength(pos_song,font)
184
+ x = math.ceil((width - textwidth) / 2)
185
+ y = math.ceil((height - math.ceil(textheight * rows / 2)) / 2)
186
+ y = y - math.ceil(y / labes_distance)
187
  draw.text((x, y), pos_song, (255,255,255), font=font)
188
 
189
+ textheight=min(math.ceil( width / 12 ), math.ceil( height / 6 ))
190
  font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
191
  textwidth = draw.textlength(pos_artist,font)
192
+ x = math.ceil((width - textwidth) / 2)
193
+ y = math.ceil((height - math.ceil(textheight * rows / 2)) / 2)
194
+ y = y + math.ceil(y / labes_distance)
195
  draw.text((x, y), pos_artist, (255,255,255), font=font)
196
 
197
  name = generate_random_string(12) + ".png"