42 lines
1.2 KiB
Java
42 lines
1.2 KiB
Java
package it.acxent.face.callable;
|
|
|
|
import it.acxent.db.ResParm;
|
|
import it.acxent.face.Foto;
|
|
import it.acxent.face.FotoI;
|
|
import java.util.concurrent.Callable;
|
|
|
|
public class IndexFotoFaceCallable implements Callable<ResParm> {
|
|
private FotoI foto;
|
|
|
|
private boolean force = false;
|
|
|
|
private boolean detectNumbers = false;
|
|
|
|
public IndexFotoFaceCallable(FotoI foto, boolean detectNumbers, boolean force) {
|
|
this.foto = foto;
|
|
this.detectNumbers = detectNumbers;
|
|
this.force = force;
|
|
}
|
|
|
|
public ResParm call() throws Exception {
|
|
ResParm rp = new ResParm();
|
|
try {
|
|
rp = Foto.loadFacesByFaceRecognition(getFoto(), this.detectNumbers, this.force);
|
|
} catch (Exception ex) {
|
|
ex.printStackTrace();
|
|
rp.setStatus(false);
|
|
rp.setMsg(getFoto().getFileNameFaceRecognition()
|
|
.substring(getFoto().getFileNameFaceRecognition().lastIndexOf("/") + 1) + " " + getFoto().getFileNameFaceRecognition().substring(getFoto().getFileNameFaceRecognition().lastIndexOf("/") + 1));
|
|
rp.setMsg(ex);
|
|
}
|
|
return rp;
|
|
}
|
|
|
|
public FotoI getFoto() {
|
|
return this.foto;
|
|
}
|
|
|
|
public void setFoto(FotoI foto) {
|
|
this.foto = foto;
|
|
}
|
|
}
|