Skip to content

Commit

Permalink
Fixed bug with Image not updating for old user
Browse files Browse the repository at this point in the history
-when capturing from webcam
  • Loading branch information
iamKunal committed Mar 6, 2017
1 parent 68fe66d commit 21012c5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/visMan/PrintUserCardController.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ public void printCard(ActionEvent event){
ch.updateUser(currentVisitor);
ch.insertReport(currentVisitor);
}
if (copyImage){
try{
Files.copy(Paths.get("temp.jpg"), Paths.get(Main.IMGDB+"/"+String.format("%09d", currentVisitor.getuID())+".jpg"), StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
// TODO: handle exception
}
}

if (copyImage){
try{
Files.copy(Paths.get("temp.jpg"), Paths.get(Main.IMGDB+"/"+String.format("%09d", currentVisitor.getuID())+".jpg"), StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
// TODO: handle exception
}
}
}
Expand Down Expand Up @@ -192,6 +193,7 @@ public void initData(Visitor oldVisitor, Visitor newVisitor){
if(!(f.exists() && !f.isDirectory())) {
f = new File(Main.IMGDB + "/" + String.format("%09d", this.currentVisitor.getuID()) +".jpg");
copyImage=false;
System.out.println("Hello");
}
Image image = new Image(f.toURI().toString());
this.visitorImage.setImage(image);
Expand Down

0 comments on commit 21012c5

Please sign in to comment.