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:{
Font f = Font.FONT_ITG_EX;
List<Glyph> glyphs = Glyph.split(cutImg);
glyphs.remove(glyphs.size()-3);
if (glyphs.size()>=3) {
glyphs.remove(glyphs.size()-3);
}
String res = f.convertGlyphs(glyphs);
return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length());
}
case 7:{
Font f = Font.FONT_ITG_PCT;
List<Glyph> glyphs = Glyph.split(cutImg);
glyphs.remove(glyphs.size()-3);
if (glyphs.size()>=3) {
glyphs.remove(glyphs.size()-3);
}
String res = f.convertGlyphs(glyphs);
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);
}
public GETRequest(String url){
this(url,30000,null);
this(url,30000,(String[])null);
}
public HttpResponse<?> run() throws FailedResponseException {
build();

Binary file not shown.

View File

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