blob: 4ce8f0d92eaefed264cb568a15499396bd92bf3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
-- set correct dimensions to frames around images
return function(dom)
local frames = dom:query_selector("draw|frame")
for _, frame in ipairs(frames) do
local images = frame:query_selector("draw|image")
if #images > 0 then
local image = images[1]
local width = image:get_attribute("svg:width")
local height = image:get_attribute("svg:height")
if widht then frame:set_attribute("svg:width", width) end
if height then frame:set_attribute("svg:height", height) end
print("image dimensions", width, height)
end
end
return dom
end
|