from exif import Image

def info(file_name):
    ret = f"Info: {file_name} - "
    try:
        with open(file_name, mode="rb") as file:
            img_bin = Image(file)
            dane = img_bin.get_all()
            ret += str(dane)
    except:
        ret += "Bład pliku"

    return ret

print(info("images/IMG_123311x.jpg"))
print(info("images/IMG_1233.jpg"))
print(info("d_01.py"))