diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua index ed78b856c60..0cfc9ba085b 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua @@ -35,7 +35,7 @@ function checkers.pdf(data) local request = data.request local used = data.used if request and used and not request.scanimage then - local image = lpdf.epdf.image + local image = lpdf.epdf.image -- ok, this is a pdf specific main function local openpdf = image.open local closepdf = image.close local querypdf = image.query @@ -127,9 +127,9 @@ function checkers.pdf(data) return genericchecker(data) end -local function wrappedidentify(identify,filename) +local function wrappedidentify(identify,filename,filetype) local wrapup = function() report_inclusion("fatal error reading %a",filename) end - local _, result = xpcall(identify,wrapup,filename) + local _, result = xpcall(identify,wrapup,filename,filetype) if result then local xsize = result.xsize or 0 local ysize = result.ysize or 0 @@ -163,10 +163,9 @@ function checkers.jpg(data) local used = data.used if request and used and not request.scanimage then local identify = graphics.identify - local inject = lpdf.injectors.jpg local found = false request.scanimage = function(t) - local result = wrappedidentify(identify,t.filename) + local result = wrappedidentify(identify,t.filename,"jpg") found = not result.error return { filename = result.filename, @@ -187,7 +186,7 @@ function checkers.jpg(data) request.copyimage = function(t) if found then found = false - return inject(t) + return backends.codeinjections.jpg(t) end end end @@ -199,10 +198,9 @@ function checkers.jp2(data) -- idem as jpg local used = data.used if request and used and not request.scanimage then local identify = graphics.identify - local inject = lpdf.injectors.jp2 local found = false request.scanimage = function(t) - local result = wrappedidentify(identify,t.filename) + local result = wrappedidentify(identify,t.filename,"jp2") found = not result.error return { filename = result.filename, @@ -223,7 +221,7 @@ function checkers.jp2(data) -- idem as jpg request.copyimage = function(t) if found then found = false - return inject(t) + return backends.codeinjections.jp2(t) end end end @@ -235,10 +233,9 @@ function checkers.png(data) -- same as jpg (for now) local used = data.used if request and used and not request.scanimage then local identify = graphics.identify - local inject = lpdf.injectors.png -- currently pdf specific local found = false request.scanimage = function(t) - local result = wrappedidentify(identify,t.filename) + local result = wrappedidentify(identify,t.filename,"png") found = not result.error return { filename = result.filename, @@ -263,7 +260,7 @@ function checkers.png(data) -- same as jpg (for now) t.colorref = used.colorref -- this is a bit of a hack if found then found = false - local ok, result = pcall(inject,t) + local ok, result = pcall(backends.codeinjections.png,t) if ok then return result else |