Using img.scan() in a tex file with \directlua works fine: \directlua{ a = img.scan({filename='foo.jpg'}) } But it segfaults if I use img.scan in a pure lua file and run it with --onlylua: a = img.scan({filename='foo.jpg'}) I have only this one line in the lua file. Do I need to import additional modules? Ciao Andreas