def METHOD_NAME(fn,outputfile):
    path,filename = os.path.split(fn)
    ext = os.path.splitext(filename)[1]
    if ext in ['.xml','.rob','.obj','.env']:
        #world file
        print(fn)
        world = WorldModel()
        world.readFile(fn)
        im = resource.thumbnail(world,(128,96))
        if im != None:
            im.save(outputfile)
        else:
            print("Could not save thumbnail.")
            exit(0)
        vis.lock()
        del world
        vis.unlock()
    elif ext in resource.known_types():
        res = resource.get(filename,doedit=False,directory=path)
        im = resource.thumbnail(res,(128,96))
        if im != None:
            im.save(outputfile)
        else:
            print("Could not save thumbnail.")
            exit(0)