[dev-context] Including gif images from the web

Aditya Mahajan adityam at umich.edu
Sun May 27 07:32:46 CEST 2012


Inclusion of gif images from the web does not work. For example:


It is a rather strange bug. In grph-inc.lua we have

     local newbase = file.addsuffix(newbase,newformat)
     local newname = file.join(newpath,newbase)

Now, since the webaddress has a dot, newbase has a dot. file.addsuffix does not
change the suffix if a file already has a suffix (and does not give any warning
about it!). So, newname does not end with .pdf, and therefore

gm convert long-path.gif long-path

does not convert to pdf--the resultant file is a gif file. Hence, direct 
inclusion of that file fails.

A simple fix is to change the addsuffix line to:

    newbase = newbase .. "." .. newformat


More information about the dev-context mailing list