Corrections with extraction system and case insensitivity fixes for

tagging.
pull/1/head
sigonasr2 5 years ago
parent acf7efa975
commit fd2481de45
  1. BIN
      Tagger/Tagger.jar
  2. 7
      Tagger/downloadedData/.gitignore
  3. BIN
      Tagger/lib/commons-exec-1.3.jar
  4. BIN
      Tagger/lib/commons-io-2.6.jar
  5. 16
      Tagger/src/Tagger.java
  6. 39
      Tagger/src/imageTag.java
  7. 2
      Tagger/src/projectBuilder.xml
  8. 131
      Tagger/whitelist.txt

Binary file not shown.

@ -1,7 +0,0 @@
/temp10131499.html
/temp48528896.html
/temp51582658.html
/temp68277325.html
/temp76863890.html
/temp76890277.html
/temp76928198.html

Binary file not shown.

Binary file not shown.

@ -5,6 +5,8 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.ImageWriteException;
import org.apache.commons.imaging.Imaging;
@ -20,6 +22,7 @@ import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
public class Tagger {
public Tagger(File imagetoTag,List<String> tags) throws ImageReadException, IOException {
System.out.println("File: "+imagetoTag.getAbsolutePath()+", "+tags);
StringBuilder sb = new StringBuilder();
if (tags!=null) {
for (String tag : tags) {
@ -29,14 +32,11 @@ public class Tagger {
sb.append(tag);
}
Process tool = Runtime.getRuntime().exec("tool.exe -exif:XPKeywords=\""+sb.toString()+"\" "+imagetoTag.getAbsolutePath()+" -overwrite_original_in_place -P");
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(tool.getInputStream()));
String s = null;
while ((s = stdInput.readLine()) != null) {
System.out.println("Tagging "+imagetoTag.getName()+":"+s);
}
//Process tool = Runtime.getRuntime().exec("tool.exe -exif:XPKeywords=\""+sb.toString()+"\" "+imagetoTag.getAbsolutePath()+" -overwrite_original_in_place -P");
String command = "tool.exe -exif:XPKeywords=\""+sb.toString()+"\" "+imagetoTag.getAbsolutePath()+" -overwrite_original_in_place -P";
CommandLine cmdLine = CommandLine.parse(command);
DefaultExecutor executor = new DefaultExecutor();
int exitValue = executor.execute(cmdLine);
}
}
}

@ -18,6 +18,10 @@ import java.util.TreeMap;
import javax.swing.JFileChooser;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.io.FileUtils;
public class imageTag {
public static Filters filters;
public static HashMap<String,Boolean> tag_whitelist = new HashMap<String,Boolean>();
@ -72,19 +76,36 @@ public class imageTag {
private static void ExtractExifTool() {
InputStream tool = imageTag.class.getResourceAsStream("exiftool.exe");
File f = new File("tool.exe");
File f = new File("tool.exe");/*
if (!f.exists()) {
try {
byte[] buffer = new byte[tool.available()];
tool.read(buffer);
OutputStream outStream = new FileOutputStream(f);
outStream.write(buffer);
outStream.close();
tool.close();
//f.deleteOnExit();
} catch (IOException e) {
e.printStackTrace();
}
}*/
try {
FileUtils.copyInputStreamToFile(tool,f);
} catch (IOException e1) {
e1.printStackTrace();
}
//Run a test of it.
System.out.println("Test run of tool to verify it is working...");
String command = "tool.exe";
CommandLine cmdLine = CommandLine.parse(command);
DefaultExecutor executor = new DefaultExecutor();
try {
byte[] buffer = new byte[tool.available()];
tool.read(buffer);
OutputStream outStream = new FileOutputStream(f);
outStream.write(buffer);
outStream.close();
tool.close();
f.deleteOnExit();
int exitValue = executor.execute(cmdLine);
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -15,6 +15,8 @@
<fileset dir="${dir.jarfile}/bin"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-imaging-1.0-alpha1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/json-20190722.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-exec-1.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-io-2.6.jar"/>
</jar>
</target>
</project>

@ -0,0 +1,131 @@
Touhou
Chen
League_of_Legends
Touhou Project
Ahri
LOL
fox ears
Kemono Friends
League of Legends
cat ears
beast ears
lol
animal ears
LoL
Kancolle
foxgirl
leagueoflegends
Kantai Collection
LeagueofLegends
League_Of_Legends
dog ears
Is the Order a Rabbit?
league_of_legends
VOCALOID
kagamine rin
League_of_legends
Virtual YouTuber
Ro-500
League
Pokémon
Squid Girl
cat ear
squid girl
No Game No Life
Konohana Kitan
hyperdimension neptunia
LeagueOfLegends
Puella Magi Madoka Magica
Leagueoflegends
SHOWBYROCK!!
The Idolmaster: Cinderella Girls
Yuzu
league
neptune
touhou
Azur Lane
Girls und Panzer
Miss Kobayashi's Dragon Maid
legends
Legends
love live!
AHRI
K/DA
Bowsette
One Piece
Sewayaki Kitsune no Senko-san
Shugo Chara!
leagueoflegend
??project
Ib
Yuru Yuri
KDA
Kiniro Mosaic
The Idolmaster
CLANNAD
The Idolmaster: Million Live!
date a live
star ocean
Re:Zero - Starting Life in Another World
Toyosatomimi no Miko
Granblue Fantasy
Lol
Rabi-Ribi
Tokyo Mew Mew
alice in wonderland
bakemonogatari
cat girl
dakimakura
little busters
little devil
Little Busters!
Senko-san
Vocaloid
nogamenolife
tokyo ravens
Love Live! Sunshine!!
Lyrical Nanoha
MACROSS Frontier
Mahou Shoujo Lyrical Nanoha
Pokémon X and Y
TERA
digimon
elin
kemonomimi
kitsune
overwatch
rabbit ears
sailor moon
squid
Black Bullet
Charlotte
Digital
KatColle
Nichijou (Keiichi Arai)
Puzzle & Dragons
Re:Zero
chen
fox girl
otter
super mario
the legend of zelda
Cinderella Girls
DOGDAYS
Haibane Renmei
Is It Wrong to Try to Pick Up Girls in a Dungeon?
League_Of_legends
Miqo'te
My Little Sister Can't Be This Cute
Ro-Kyu-Bu!
Star Ocean 3
Tales
The Ryuo's Work is Never Done!
a certain magical index
clannad
ff14
kemono
neko musume
project
sailormoon
sakura trick
vocaloid
Loading…
Cancel
Save