ITGreader invalid data fix

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2 2022-08-20 11:30:40 -05:00
parent d7115ef89f
commit baf1916417
25 changed files with 18 additions and 11 deletions

BIN
bin/ArcadeReader$1.class Normal file

Binary file not shown.

BIN
bin/ArcadeReader.class Normal file

Binary file not shown.

Binary file not shown.

BIN
bin/readers/Box.class Normal file

Binary file not shown.

Binary file not shown.

BIN
bin/readers/DDRReader.class Normal file

Binary file not shown.

BIN
bin/readers/ITGReader.class Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/readers/Reader.class Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/sigPlace.class Normal file

Binary file not shown.

BIN
bin/sigServer.class Normal file

Binary file not shown.

View File

@ -170,14 +170,19 @@ public class ITGReader extends Reader{
case 0:{ case 0:{
Font f = Font.FONT_ITG_EX; Font f = Font.FONT_ITG_EX;
List<Glyph> glyphs = Glyph.split(cutImg); List<Glyph> glyphs = Glyph.split(cutImg);
if (glyphs.size()>=3) {
glyphs.remove(glyphs.size()-3); glyphs.remove(glyphs.size()-3);
}
String res = f.convertGlyphs(glyphs); String res = f.convertGlyphs(glyphs);
return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length()); return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length());
} }
case 7:{ case 7:{
Font f = Font.FONT_ITG_PCT; Font f = Font.FONT_ITG_PCT;
List<Glyph> glyphs = Glyph.split(cutImg); List<Glyph> glyphs = Glyph.split(cutImg);
if (glyphs.size()>=3) {
glyphs.remove(glyphs.size()-3); glyphs.remove(glyphs.size()-3);
}
String res = f.convertGlyphs(glyphs); String res = f.convertGlyphs(glyphs);
return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length()); return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length());
} }

View File

@ -50,7 +50,7 @@ public class GETRequest{
this(url,timeout,null,headers); this(url,timeout,null,headers);
} }
public GETRequest(String url){ public GETRequest(String url){
this(url,30000,null); this(url,30000,(String[])null);
} }
public HttpResponse<?> run() throws FailedResponseException { public HttpResponse<?> run() throws FailedResponseException {
build(); build();

Binary file not shown.

View File

@ -110,6 +110,7 @@ public class sigPlace {
} }
final Path temp = Paths.get("temp.png"); final Path temp = Paths.get("temp.png");
Reader result = ArcadeReader.interpret(screenshot); Reader result = ArcadeReader.interpret(screenshot);
if (result!=null) {
System.out.println("Detected as "+result.getClass().getSimpleName()); System.out.println("Detected as "+result.getClass().getSimpleName());
ImageIO.write(screenshot,"png",temp.toFile()); ImageIO.write(screenshot,"png",temp.toFile());
result.interpretBoxes(temp, true); result.interpretBoxes(temp, true);
@ -119,6 +120,7 @@ public class sigPlace {
/*if (result.isReasonableData()) { /*if (result.isReasonableData()) {
POSTRequest postRes = new POSTRequest("http://"+args[0]+"/uploadform.html",Path.of("..",filename)); POSTRequest postRes = new POSTRequest("http://"+args[0]+"/uploadform.html",Path.of("..",filename));
}*/ }*/
}
Thread.sleep(50); Thread.sleep(50);
} }
} catch (AWTException | InterruptedException | IOException e) { } catch (AWTException | InterruptedException | IOException e) {