Show filename on error in crash.log

pull/825/head
WS64 10 years ago
parent 043dc13a24
commit 4599d02c6f

@ -18,10 +18,11 @@ local ImageWidget = Widget:new{
function ImageWidget:_render()
local itype = string.lower(string.match(self.file, ".+%.([^.]+)") or "")
if itype == "jpeg" or itype == "jpg" then
self._bb = Image:fromJPEG(self.file)
elseif itype == "png" then
self._bb = Image:fromPNG(self.file)
if itype == "png" or itype == "jpg" or itype == "jpeg"
or itype == "tiff" then
self._bb = Image:fromFile(self.file, self.width, self.height)
else
error(self.file .. ": Image file type not supported.")
end
local w, h = self._bb:getWidth(), self._bb:getHeight()
if (self.width and self.width ~= w) or (self.height and self.height ~= h) then

Loading…
Cancel
Save