Omnibus commited on
Commit
48d7308
·
verified ·
1 Parent(s): 2bf51b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -288,17 +288,19 @@ def nasa_sdo_images(obj,size,date1,date2):
288
  return html_in
289
 
290
  def get_concat_h_cut(in1, in2):
 
291
  im1=Image.open(in1)
292
  im2=Image.open(in2)
293
  dst = Image.new('RGB', (im1.width + im2.width,
294
  min(im1.height, im2.height)))
295
  dst.paste(im1, (0, 0))
296
  dst.paste(im2, (im1.width, 0))
297
- dst.save("h_out.jpg")
298
- return "h_out.jpg"
299
 
300
 
301
  def get_concat_v_cut(in1, in2, theme='dark'):
 
302
  im1=Image.open(in1)
303
  im2=Image.open(in2)
304
  if theme=='dark':
@@ -308,8 +310,8 @@ def get_concat_v_cut(in1, in2, theme='dark'):
308
  dst = Image.new('RGB', (min(im1.width, im2.width), im1.height + im2.height),color=color)
309
  dst.paste(im1, (0, 0))
310
  dst.paste(im2, (0, im1.height))
311
- dst.save("v_out.jpg")
312
- return "v_out.jpg"
313
 
314
 
315
 
 
288
  return html_in
289
 
290
  def get_concat_h_cut(in1, in2):
291
+ uid=uuid.uuid4()
292
  im1=Image.open(in1)
293
  im2=Image.open(in2)
294
  dst = Image.new('RGB', (im1.width + im2.width,
295
  min(im1.height, im2.height)))
296
  dst.paste(im1, (0, 0))
297
  dst.paste(im2, (im1.width, 0))
298
+ dst.save(f"h_{uid}.jpg")
299
+ return f"h_{uid}.jpg"
300
 
301
 
302
  def get_concat_v_cut(in1, in2, theme='dark'):
303
+ uid=uuid.uuid4()
304
  im1=Image.open(in1)
305
  im2=Image.open(in2)
306
  if theme=='dark':
 
310
  dst = Image.new('RGB', (min(im1.width, im2.width), im1.height + im2.height),color=color)
311
  dst.paste(im1, (0, 0))
312
  dst.paste(im2, (0, im1.height))
313
+ dst.save(f"v_{uid}.jpg")
314
+ return f"v_{uid}.jpg"
315
 
316
 
317