def METHOD_NAME(settings, tmpdir):
    settings["destination"] = str(tmpdir)
    gal = Gallery(settings, ncpu=1)
    extended_caching.save_cache(gal)
    assert gal.metadataCache
    # test if file disappears
    gal.albums["exifTest"].medias.append(Image("foooo.jpg", "exifTest", settings))
    # set mod_date to -1 to force cache update
    gal.metadataCache = {
        "exifTest/_index": {
            "mod_date": -1,
        },
        "exifTest/21.jpg": {"exif": "Foo", "mod_date": -1},
        "exifTest/foooo.jpg": {"exif": "Foo"},
        "dir1/test2/22.jpg": {
            "exif": "Bar",
            "mod_date": 100000000000,
            "meta_mod_date": -1,
            "markdown_metadata": "Bar",
        },
    }
    # errors should all be caught
    extended_caching.load_metadata(gal.albums["exifTest"])
    assert gal.albums["exifTest"].medias[0].exif != "Foo"
    assert gal.albums["exifTest"].medias[-1].exif != "Foo"
    extended_caching.load_metadata(gal.albums["dir1/test2"])
    assert gal.albums["dir1/test2"].medias[1].exif == "Bar"
    assert gal.albums["dir1/test2"].medias[1].markdown_metadata != "Bar"