diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-05-05 19:33:15 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-05-05 19:33:15 +0200 |
commit | cc6d486ffa3fad4ffb698ad5ccbd5c5f4ebc6a00 (patch) | |
tree | 787c75ff830863d992f7301542a00be25b032dbf /tex/context/base/mkxl/lpdf-img.lmt | |
parent | a0e79ce94348b934dcefc38133cd8fed08bd38e3 (diff) | |
download | context-cc6d486ffa3fad4ffb698ad5ccbd5c5f4ebc6a00.tar.gz |
2023-05-05 18:39:00
Diffstat (limited to 'tex/context/base/mkxl/lpdf-img.lmt')
-rw-r--r-- | tex/context/base/mkxl/lpdf-img.lmt | 12 |
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, |