def METHOD_NAME(image_dir):
    prefix = config.data_root + '/bad'
    assert coverlib.write_image(b'', prefix) is None
    prefix = config.data_root + '/bad'
    assert coverlib.write_image(b'not an image', prefix) is None