From 7ed1810847decb36704e7a5ca40a48e6caf80c26 Mon Sep 17 00:00:00 2001 From: senshu Date: Tue, 1 Aug 2017 21:21:22 +0200 Subject: [PATCH] Attempt to fix invalid image path when exporting to video in Windows --- lib/index.js | 2 +- lib/sozi-to-pdf.js | 6 +++--- lib/sozi-to-video.js | 6 +++--- package.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/index.js b/lib/index.js index 63d602b..984eb2e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -127,7 +127,7 @@ exports.convertToVideo = function (inputFileName, options) { // Convert a sequence of image files "-f", "image2", // The list of image files - "-i", path.join(tmpDir.name, "%d.png"), + "-i", path.join(tmpDir.name, "img%d.png"), // The video bit rate "-b:v", options.bitRate, // Overwrite the output file without asking diff --git a/lib/sozi-to-pdf.js b/lib/sozi-to-pdf.js index e636bb9..67966e9 100644 --- a/lib/sozi-to-pdf.js +++ b/lib/sozi-to-pdf.js @@ -5,6 +5,7 @@ "use strict"; var system = require("system"); +var fs = require("fs"); var page = require("webpage").create(); var tmpDir; @@ -20,9 +21,8 @@ page.onConsoleMessage = function (msg) { * Render the current page into a PDF file. * Called from sandboxed Javascript. */ -page.onCallback = function (fileName) { -// page.zoomFactor = 0.5; - page.render(tmpDir + "/" + fileName + ".png", {format: "png", quality: 100}); +page.onCallback = function (index) { + page.render(tmpDir + fs.separator + "img" + index + ".png", {format: "png", quality: 100}); }; /* diff --git a/lib/sozi-to-video.js b/lib/sozi-to-video.js index d729279..b20dab6 100644 --- a/lib/sozi-to-video.js +++ b/lib/sozi-to-video.js @@ -5,6 +5,7 @@ "use strict"; var system = require("system"); +var fs = require("fs"); var page = require("webpage").create(); var tmpDir; var Timing = require("./Timing"); @@ -21,9 +22,8 @@ page.onConsoleMessage = function (msg) { * Render the current page into a PDF file. * Called from sandboxed Javascript. */ -page.onCallback = function (fileName) { -// page.zoomFactor = 0.5; - page.render(tmpDir + "/" + fileName + ".png", {format: "png", quality: 100}); +page.onCallback = function (index) { + page.render(tmpDir + fs.separator + "img" + index + ".png", {format: "png", quality: 100}); }; /* diff --git a/package.json b/package.json index a23bae8..bc2676c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sozi-export", - "version": "17.07.30", + "version": "17.08.01", "description": "Convert a Sozi presentation to PDF, PPTX or video", "author": "Guillaume Savaton", "license": "MPL-2.0",