mirror of
https://github.com/Paillat-dev/FABLE.git
synced 2026-01-02 09:16:20 +00:00
Added and fixed a whole bunch of things
This commit is contained in:
@@ -61,7 +61,15 @@ def generate_miniature(path, title, description):
|
||||
generate_image(path, text1, text2)
|
||||
|
||||
def generate_image(path, text1, text2):
|
||||
bcg = Image.open("bcg.png")
|
||||
path_to_bcg = path.split("/")[:-1]
|
||||
path_to_bcg = "/".join(path_to_bcg)
|
||||
print(path_to_bcg)
|
||||
if not os.path.exists(f"{path_to_bcg}/bcg.png"):
|
||||
input("bcg.png not found. Please put bcg.png in the same folder as the video."+path_to_bcg)
|
||||
if not os.path.exists(f"{path_to_bcg}/bcg.png"):
|
||||
input("bcg.png still not found. Exiting.")
|
||||
exit()
|
||||
bcg = Image.open(f"{path_to_bcg}/bcg.png")
|
||||
img = Image.new('RGBA', (1920, 1080))
|
||||
img, textcolor1, textcolor2 = rand_gradient(img)
|
||||
draw = ImageDraw.Draw(img)
|
||||
@@ -107,6 +115,4 @@ def generate_image(path, text1, text2):
|
||||
else:
|
||||
img.paste(imgtext2, (0, 0), imgtext2)
|
||||
img.save(path + "/miniature.png")
|
||||
return path + "/miniature.png"
|
||||
|
||||
generate_image("test", "Master python loops", "Effortlessly")
|
||||
return path + "/miniature.png"
|
||||
Reference in New Issue
Block a user