File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed
bin/com/rahul/chessvision
src/com/rahul/chessvision Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 1+ package com .rahul .chessvision ;
2+
3+ import java .io .BufferedReader ;
4+ import java .io .File ;
5+ import java .io .FileReader ;
6+
7+ public class CreateImage {
8+
9+ private static String FILE_PATH = "/home/rahul/Documents/deep_workspace/DeepLearning/logs/game4.fen" ;
10+
11+ private static void readAndConvert () {
12+ String fen ;
13+ int counter = 0 ;
14+ BufferedReader br = null ;
15+ try {
16+ br = new BufferedReader (new FileReader (new File (FILE_PATH )));
17+ while ((fen = br .readLine ()) != null ) {
18+ if (!DrawBoard .fenToPng (fen ))
19+ System .out .println ("Oops! Check code.." );
20+ Thread .sleep (50 );
21+ counter ++;
22+ }
23+ } catch (Exception e ) {
24+ e .printStackTrace ();
25+ }
26+ System .out .println (counter + " images created." );
27+ }
28+
29+ public static void main (String [] args ) {
30+ readAndConvert ();
31+ }
32+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ public class DrawBoard {
1010 private static final String PRE_STRING_PATH = "./html/pre.txt" ;
1111 private static final String POST_STRING_PATH = "./html/post.txt" ;
1212 private static final String HTML_FILE_PATH = "./html/index.html" ;
13- private static final String CMD = "./lib/wkhtmltoimage.exe --crop-w 412 ./html/index.html ./img/" ;
13+ private static final String CMD = "./lib/wkhtmltoimage --crop-w 412 ./html/index.html ./img/" ;
1414
1515 public static boolean fenToHtml (String fen ) {
1616 String html = "" , line ;
@@ -51,7 +51,7 @@ private static boolean htmlToPng() {
5151 }
5252
5353 public static boolean fenToPng (String fen ) {
54- return fenToHtml (fen ) && htmlToPng ();
54+ return fenToHtml (fen ) & htmlToPng ();
5555 }
5656
5757 public static void main (String [] args ) {
You can’t perform that action at this time.
0 commit comments