summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/lpdf-img.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/lpdf-img.lmt')
-rw-r--r--tex/context/base/mkxl/lpdf-img.lmt12
1 files changed, 12 insertions, 0 deletions
diff --git a/tex/context/base/mkxl/lpdf-img.lmt b/tex/context/base/mkxl/lpdf-img.lmt
index c241ccdb7..e7dc663d6 100644
--- a/tex/context/base/mkxl/lpdf-img.lmt
+++ b/tex/context/base/mkxl/lpdf-img.lmt
@@ -67,6 +67,7 @@ local zlibcompress = xzip.compress
local zlibdecompress = xzip.decompress
local trace = false
+local cleanvirtual = resolvers.cleaners.virtual -- false -- for now
local report_jpg = logs.reporter("graphics","jpg")
local report_jp2 = logs.reporter("graphics","jp2")
@@ -74,6 +75,8 @@ local report_png = logs.reporter("graphics","png")
trackers.register("graphics.backend", function(v) trace = v end)
+directives.register("graphics.cleanvirtuals", function(v) cleanvirtual = v and resolvers.cleaners.virtual or false end)
+
local injectors = { }
lpdf.injectors = injectors
@@ -158,6 +161,9 @@ do
if trace then
report_jpg("%s: width %i, height %i, colordepth %i, size %i",filename,xsize,ysize,colordepth,#content)
end
+ if cleanvirtual then
+ cleanvirtual(filename)
+ end
return createimage {
bbox = { 0, 0, specification.width/xsize, specification.height/ysize }, -- mandate
transform = specification.transform,
@@ -197,6 +203,9 @@ do
if trace then
report_jp2("%s: width %i, height %i, size %i",filename,xsize,ysize,#content)
end
+ if cleanvirtual then
+ cleanvirtual(filename)
+ end
return createimage {
bbox = { 0, 0, specification.width/xsize, specification.height/ysize }, -- mandate
transform = specification.transform,
@@ -1211,6 +1220,9 @@ do
end
local width = specification.width or xsize * 65536
local height = specification.height or ysize * 65536
+ if cleanvirtual then
+ cleanvirtual(filename)
+ end
return createimage {
bbox = { 0, 0, width/xsize, height/ysize }, -- mandate
transform = specification.transform,