private void close(boolean x) {
            try {                
                output.close();
            } catch (IOException ex) {
                Logger.getLogger(ProcessData.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            //try {
                bridge.getAppRef().setPhoto(imgName);
                //Thread.sleep(150);
                //File showImg =new File( file );
                //Desktop.getDesktop().open(showImg);
            //} catch (InterruptedException | IOException ex) {
            //    Logger.getLogger(ProcessData.class.getName()).log(Level.SEVERE, null, ex);
            //}
            closed=true;
            run=false;
            
            startTimer("getNewImage");
        }