summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-06 21:58:15 +0000
committerKarl Berry <karl@freefriends.org>2021-03-06 21:58:15 +0000
commit974640d66e61e81cb197ad96fdff7b08343e4c5a (patch)
tree2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
parentb4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff)
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/grph-img.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-img.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
index 4b4bee1fc08..0dc5efa7038 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
@@ -97,6 +97,13 @@ do
[0x01] = { name = "TEM", zerolength = true }, -- temporary use
}
+ setmetatableindex(tags, function(t,k)
+ -- we can add some tracing if needed (global) to get an idea
+ local v = "tag " .. k
+ t[k] = v
+ return v
+ end)
+
-- More can be found in http://www.exif.org/Exif2-2.PDF but basically we have
-- good old tiff tags here.
@@ -254,7 +261,7 @@ do
local length = 0
local tagdata = tags[category]
if not tagdata then
- specification.error = "invalid tag"
+ specification.error = "invalid tag " .. (category or "?")
break
elseif tagdata.supported == false then
specification.error = "unsupported " .. tagdata.comment
@@ -602,8 +609,11 @@ do
local y = f:readcardinal4()
local u = f:readcardinal()
if u == 1 then -- meters
- -- x = round(0.0254 * x)
- -- y = round(0.0254 * y)
+ -- there was a reason why this was commented
+ x = round(0.0254 * x)
+ y = round(0.0254 * y)
+ if x == 0 then x = 1 end
+ if y == 0 then y = 1 end
end
specification.xres = x
specification.yres = y