imagebox: Remove dead code
Since some commits, surface.load() handles printing an error message for us. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
9d97a98b4d
commit
76b1d348a1
|
@ -72,17 +72,16 @@ end
|
||||||
--- Set an imagebox' image
|
--- Set an imagebox' image
|
||||||
-- @param image Either a string or a cairo image surface. A string is
|
-- @param image Either a string or a cairo image surface. A string is
|
||||||
-- interpreted as the path to a png image file.
|
-- interpreted as the path to a png image file.
|
||||||
|
-- @return true on success, false if the image cannot be used
|
||||||
function imagebox:set_image(image)
|
function imagebox:set_image(image)
|
||||||
local image = image
|
local image = image
|
||||||
|
|
||||||
if type(image) == "string" then
|
if type(image) == "string" then
|
||||||
local success, result = pcall(surface.load, image)
|
image = surface.load(image)
|
||||||
if not success then
|
if not image then
|
||||||
print("Error while reading '" .. image .. "': " .. result)
|
|
||||||
print(debug.traceback())
|
print(debug.traceback())
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
image = result
|
|
||||||
end
|
end
|
||||||
|
|
||||||
image = surface.load(image)
|
image = surface.load(image)
|
||||||
|
|
Loading…
Reference in New Issue