- Timestamp:
- 2017-05-08T21:18:21+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapRetrieve.java
r28966 r31665 23 23 import org.greenstone.gsdl3.util.GSXML; 24 24 import org.greenstone.gsdl3.util.XMLConverter; 25 import org.greenstone.util.SafeProcess; 25 26 26 27 import org.w3c.dom.Document; … … 459 460 // get the map size 460 461 String get_size[] = { "identify", "-size", "10000", temp_image_file }; 462 /* 461 463 Process proc; 462 464 proc = Runtime.getRuntime().exec(get_size); … … 464 466 img_size = br.readLine(); 465 467 proc.waitFor(); 468 */ 469 SafeProcess proc = new SafeProcess(get_size); 470 proc.runProcess(); 471 img_size = proc.getStdOutput(); 472 proc = null; 473 466 474 img_size = img_size.substring(img_size.indexOf("JPEG") + 5, img_size.indexOf(" ", img_size.indexOf("JPEG") + 5)); 467 475 width = Integer.parseInt(img_size.substring(0, img_size.indexOf("x"))); … … 541 549 BufferedWriter bw = new BufferedWriter(new FileWriter(this.temp_files_dir + "add_x_" + uid)); 542 550 ; 543 Process proc;551 SafeProcess proc; 544 552 545 553 // if a new search … … 547 555 { 548 556 // copy requested map to temp.jpg 549 proc = Runtime.getRuntime().exec("cp " + this.files_home_dir + "maps" + File.separator + img_num + ".jpg " + temp_image_file); 550 proc.waitFor(); 557 /*proc = Runtime.getRuntime().exec("cp " + this.files_home_dir + "maps" + File.separator + img_num + ".jpg " + temp_image_file); 558 proc.waitFor();*/ 559 proc = new SafeProcess("cp " + this.files_home_dir + "maps" + File.separator + img_num + ".jpg " + temp_image_file); 560 proc.runProcess(); 561 proc = null; 551 562 } 552 563 553 564 //get the image size 554 565 String get_size[] = { "identify", "-size", "10000", temp_image_file }; 555 proc = Runtime.getRuntime().exec(get_size);566 /*proc = Runtime.getRuntime().exec(get_size); 556 567 BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream())); 557 568 img_size = br.readLine(); 558 569 proc.waitFor(); 570 */ 571 proc = new SafeProcess(get_size); 572 proc.runProcess(); 573 img_size = proc.getStdOutput(); 574 proc = null; 575 559 576 img_size = img_size.substring(img_size.indexOf("JPEG") + 5, img_size.indexOf(" ", img_size.indexOf("JPEG") + 5)); 560 577 if (img_size.indexOf("+") != -1) … … 754 771 buf.close(); 755 772 // execute the command for the legend image 756 proc = Runtime.getRuntime().exec("sh " + this.temp_files_dir + "add_l_" + uid); 757 proc.waitFor(); 773 /*proc = Runtime.getRuntime().exec("sh " + this.temp_files_dir + "add_l_" + uid); 774 proc.waitFor();*/ 775 proc = new SafeProcess("sh " + this.temp_files_dir + "add_l_" + uid); 776 proc.runProcess(); 777 proc = null; 758 778 } 759 779 inType.close(); … … 763 783 764 784 // execute the convert commands etc. 765 proc = Runtime.getRuntime().exec("sh " + this.temp_files_dir + "add_x_" + uid);785 /*proc = Runtime.getRuntime().exec("sh " + this.temp_files_dir + "add_x_" + uid); 766 786 proc.waitFor(); 787 */ 788 proc = new SafeProcess("sh " + this.temp_files_dir + "add_x_" + uid); 789 proc.runProcess(); 790 proc = null; 767 791 768 792 }
Note:
See TracChangeset
for help on using the changeset viewer.