Cannot identify image file PIL python discordpy

@client.command()
async def art(ctx):
    im1 = Image.open(r'C:/Users/danii/PycharmProject/dsbot/source.jpg')
    im1_w, im1_h = im1.size
    font = ImageFont.truetype(r'C:/Users/danii/Desktop/fonts/arial.ttf', 50)
    pasteurl = ctx.message.author.avatar_url
    print(pasteurl)
    p = requests.get(pasteurl)
    out = open("empty.png", "wb")
    out.write(p.content)
    path = r"C:/Users/danii/PycharmProject/dsbot/empty.png"
    outfinal = Image.open(path)
    img_w, img_h = outfinal.size
    offset = ((im1_w - img_w) // 2, (im1_h - img_h) // 2)
    out.close()
    im1.paste(out, offset)
    draw = ImageDraw.Draw(im1)
    draw.text((100, 200), ctx.author.name, (10, 50, 120), font=font)
    im1.save(r'C:/Users/danii/PycharmProject/dsbot/result.jpg')
    file = File(r"C:/Users/danii/PycharmProject/dsbot/result.jpg", filename="arti.jpg")
    await ctx.send("", file=file)

Вот мой код. Я пытаюсь отправить карттинку с ником и аватаркой вызвавшего команду. Ошибка: ПОФИКШЕНО

PIL.UnidentifiedImageError: cannot identify image file 'C:/Users/danii/PycharmProject/dsbot/empty.png'

Ответы (0 шт):