aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java
diff options
context:
space:
mode:
authorMoulberry <james.jenour@student.scotch.wa.edu.au>2020-11-08 17:44:27 +1100
committerMoulberry <james.jenour@student.scotch.wa.edu.au>2020-11-08 17:44:27 +1100
commit07403ec86c53f67b94d988b4c01a0afc2fdb2810 (patch)
treefba4b3c37b02c42267e03a07453d3941c98fd66d /src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java
parentfc4143dd3c892b11ae5f427fcecc22044ff98460 (diff)
parentec0660e41145d3d9ed479b3e697afddf8ddc8c4c (diff)
downloadnotenoughupdates-07403ec86c53f67b94d988b4c01a0afc2fdb2810.tar.gz
notenoughupdates-07403ec86c53f67b94d988b4c01a0afc2fdb2810.tar.bz2
notenoughupdates-07403ec86c53f67b94d988b4c01a0afc2fdb2810.zip
Merge branch 'beta'
uh yeah its pretty necessary guys
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java
index 3e9cdb3f..c03b98fb 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/HTMLInfoPane.java
@@ -136,6 +136,10 @@ public class HTMLInfoPane extends TextInfoPane {
return new HTMLInfoPane(overlay, manager, name, filename, html);
}
+ private String spaceEscape(String str) {
+ return str.replace(" ", "\\ ");
+ }
+
/**
* Uses the wkhtmltoimage command-line tool to generate an image from the HTML code. This
* generation is done asynchronously as sometimes it can take up to 10 seconds for more
@@ -190,9 +194,16 @@ public class HTMLInfoPane extends TextInfoPane {
EnumChatFormatting.GRAY+"), please wait...";
Runtime runtime = Runtime.getRuntime();
- Process p = runtime.exec("\""+wkHtmlToImage.getAbsolutePath() + "\" --width "+
+
+ String[] wkCommand = new String[]{ wkHtmlToImage.getAbsolutePath(), "--width", ""+IMAGE_WIDTH*ZOOM_FACTOR,
+ "--transparent", "--zoom", ""+ZOOM_FACTOR, input.getAbsolutePath(), output.getAbsolutePath()};
+ Process p = runtime.exec(wkCommand);
+ /*Process p = runtime.exec(spaceEscape(wkHtmlToImage.getAbsolutePath()) + " --width "+
+ IMAGE_WIDTH*ZOOM_FACTOR+" --transparent --zoom "+ZOOM_FACTOR + " " + spaceEscape(input.getAbsolutePath()) +
+ " " + spaceEscape(output.getAbsolutePath()));*/
+ /*Process p = runtime.exec("\""+wkHtmlToImage.getAbsolutePath() + "\" --width "+
IMAGE_WIDTH*ZOOM_FACTOR+" --transparent --zoom "+ZOOM_FACTOR+" \"" + input.getAbsolutePath() +
- "\" \"" + output.getAbsolutePath() + "\"");
+ "\" \"" + output.getAbsolutePath() + "\"");*/
/*Process p2 = runtime.exec("\""+wkHtmlToImage.getAbsolutePath() + "\" --width "+
(IMAGE_WIDTH+EXT_WIDTH)*ZOOM_FACTOR+" --transparent --zoom "+ZOOM_FACTOR+" \"" + input.getAbsolutePath() +
"\" \"" + outputExt.getAbsolutePath() + "\"");*/