From a99f492488da19bf7a18adf09abaaac1ec07e2fb Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Thu, 28 Mar 2013 16:36:39 +0100 Subject: [PATCH] piston: improved suffix handling Avoid to pick the greedest suffix (such as "pdf.png" in a.pdf.png) but take the shortest ending one ("png"). --- piston.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piston.lua b/piston.lua index c4533fe..7a365b7 100644 --- a/piston.lua +++ b/piston.lua @@ -297,7 +297,7 @@ generator.view = {} -- Inject the export method into Adg.Canvas rawset(Adg.Canvas, 'export', function (canvas, file, format) -- The not explicitely set, the export format is guessed from the file suffix - if not format then format = file:match('%.(.*)$') end + if not format then format = file:match('%.([^.]+)$') end local size = canvas:get_size() size.x = size.x + canvas:get_left_margin() + canvas:get_right_margin() -- 2.11.4.GIT