On Fri, 12 Apr 2013, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
I tried to make a "more minimal" example.
Still we have:
files:
./t3.mkiv ./T/Kn.pdf
and code:
---- \startluacode test = function(fn) local fig = figures.push{name = fn} if figures.identify().status.status ~= 0 then figures.check() end figures.pop()
return fn .. ": " .. (fig.used.pages or "?") .. "\\par" end \stopluacode
\starttext AAA
\startluacode context(test("T/Kn.pdf")) -- Found - OK context(test("Kn.pdf")) -- Not found - OK \stopluacode
\setupexternalfigures[directory=T]
\startluacode context(test("Kn.pdf")) -- Not found (or unknown number of pages) - UNEXPECTED - why? ("3rd call") \stopluacode
\externalfigure[Kn.pdf][scale=625] % Found - OK \stoptext ----
The 3rd call of 'test()' seems to not locate 'Kn.pdf' although the path was altered by preceding \setupexternalfigures.
How to modify the 'test()' to work properly even in the 3rd case?
Look at figres.setpath() in grph-inc.lua and search figures.paths and figures_paths to see how it is used. Aditya