From 9dbd091815506c26200b4b12055002d1540acd89 Mon Sep 17 00:00:00 2001 From: ryoja Date: Mon, 24 Aug 2015 23:59:00 +0900 Subject: [PATCH] In the file name '%[0-9]{1,2}d' if it contains takes precedence there. --- lib/video.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/video.js b/lib/video.js index 2aa43e3..afffc34 100644 --- a/lib/video.js +++ b/lib/video.js @@ -762,7 +762,12 @@ module.exports = function (filePath, settings, infoConfiguration, infoFile) { } } // At the filename will added the number of the frame - settings.file_name = path.basename(settings.file_name, path.extname(settings.file_name)) + '_%d.jpg'; + settings.file_name = path.basename(settings.file_name, path.extname(settings.file_name)); + if (settings.file_name.match(/%[0-9]{1,2}d/)) { + settings.file_name += '.jpg'; + } else { + settings.file_name += '_%d.jpg'; + } // Create the directory to save the extracted frames utils.mkdir(destinationFolder, 0777);