From 21012c52df9674e84910ee6daebb35c98d7e5e3f Mon Sep 17 00:00:00 2001 From: Kunal Gupta Date: Tue, 7 Mar 2017 03:37:07 +0530 Subject: [PATCH] Fixed bug with Image not updating for old user -when capturing from webcam --- src/visMan/PrintUserCardController.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/visMan/PrintUserCardController.java b/src/visMan/PrintUserCardController.java index ff8570b..a3eaf4b 100644 --- a/src/visMan/PrintUserCardController.java +++ b/src/visMan/PrintUserCardController.java @@ -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 } } } @@ -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);