summaryrefslogtreecommitdiff
path: root/tex/context/base/grph-inc.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-10-18 11:11:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-10-18 11:11:00 +0200
commitec84960ca720596a893b4e8c3e127f7aab571f10 (patch)
tree196b3917e79ad0dd2d410fcc61aef49faede29bb /tex/context/base/grph-inc.lua
parentce89840000bacc1d01ad2b4a2a799901d825eb12 (diff)
downloadcontext-ec84960ca720596a893b4e8c3e127f7aab571f10.tar.gz
beta 2010.10.18 11:11
Diffstat (limited to 'tex/context/base/grph-inc.lua')
-rw-r--r--tex/context/base/grph-inc.lua54
1 files changed, 40 insertions, 14 deletions
diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua
index 651ed7157..5f290edb1 100644
--- a/tex/context/base/grph-inc.lua
+++ b/tex/context/base/grph-inc.lua
@@ -75,8 +75,12 @@ function img.totable(imgtable)
return result
end
-function img.serialize(i)
- return table.serialize(img.totable(i))
+function img.serialize(i,...)
+ return table.serialize(img.totable(i),...)
+end
+
+function img.print(i,...)
+ return table.print(img.totable(i),...)
end
function img.clone(i,data)
@@ -142,7 +146,7 @@ figures.cachepaths = allocate {
figures.paths = allocate(table.copy(figures.localpaths))
figures.order = allocate{
- "pdf", "mps", "jpg", "png", "jbig", "svg", "eps", "gif", "mov", "buffer", "tex",
+ "pdf", "mps", "jpg", "png", "jbig", "svg", "eps", "gif", "mov", "buffer", "tex", "cld",
}
figures.formats = allocate{
@@ -157,6 +161,7 @@ figures.formats = allocate{
["mov"] = { list = { "mov", "flv", "mp4" } }, -- "avi" is not supported
["buffer"] = { list = { "tmp", "buffer", "buf" } },
["tex"] = { list = { "tex" } },
+ ["cld"] = { list = { "cld" } },
}
function figures.setlookups()
@@ -355,6 +360,8 @@ end
local defaultformat = "pdf"
local defaultprefix = "m_k_i_v_"
+-- todo: local path or cache path
+
local function register(askedname,specification)
if specification then
local format = specification.format
@@ -384,6 +391,7 @@ local function register(askedname,specification)
if converter[newformat] then
converter = converter[newformat]
else
+ converter = nil
newformat = defaultformat
end
end
@@ -392,6 +400,7 @@ local function register(askedname,specification)
end
if converter then
local oldname = specification.fullname
+local oldname = specification.foundname
local newpath = file.dirname(oldname)
local oldbase = file.basename(oldname)
local newbase = file.removesuffix(oldbase)
@@ -401,6 +410,12 @@ local function register(askedname,specification)
else
newbase = defaultprefix .. newbase
end
+ if not file.is_writable(newpath) then
+ if trace_conversion then
+ report_graphics("[ath '%s'is not writable, forcing conversion path '.' ",newpath)
+ end
+ newpath = "."
+ end
local subpath = specification.subpath or figures.cachepaths.subpath
if subpath and subpath ~= "" and subpath ~= "." then
newpath = newpath .. "/" .. subpath
@@ -812,6 +827,12 @@ function checkers.generic(data)
du.width = figure.width
du.height = figure.height
du.pages = figure.pages
+ du.depth = figure.depth or 0
+ du.colordepth = figure.colordepth or 0
+ du.xresolution = figure.xres or 0
+ du.yresolution = figure.yres or 0
+ du.xsize = figure.xsize or 0
+ du.ysize = figure.ysize or 0
ds.private = figure
ds.hash = hash
end
@@ -928,17 +949,6 @@ function checkers.mps(data)
end
includers.mps = includers.nongeneric
--- -- -- buffer -- -- --
-
-function existers.buffer(askedname)
- askedname = file.nameonly(askedname)
- return buffers.exists(askedname) and askedname
-end
-function checkers.buffer(data)
- return checkers.nongeneric(data,format("\\docheckfigurebuffer{%s}", file.nameonly(data.used.fullname)))
-end
-includers.buffers = includers.nongeneric
-
-- -- -- tex -- -- --
function existers.tex(askedname)
@@ -950,6 +960,22 @@ function checkers.tex(data)
end
includers.tex = includers.nongeneric
+-- -- -- buffer -- -- --
+
+existers.buffer = existers.tex
+function checkers.buffer(data)
+ return checkers.nongeneric(data,format("\\docheckfigurebuffer{%s}", file.nameonly(data.used.fullname)))
+end
+includers.buffers = includers.nongeneric
+
+-- -- -- cld -- -- --
+
+existers.cld = existers.tex
+function checkers.cld(data)
+ return checkers.nongeneric(data,format("\\docheckfigurecld{%s}", data.used.fullname))
+end
+includers.cld = includers.nongeneric
+
-- -- -- converters -- -- --
local function makeoptions(options)