Eric Bergman-Terrell's Blog

Vault 3 Version 0.21 Released
November 6, 2009

Vault v. 0.21

Vault 3 version 0.21 is now available. In this version, if you specify an external photo editing program, you can edit a photo by selecting File / Edit Photo File when a photo is displayed.

Configure Photo Editing Program

On Windows machines I use paint.net to edit photos. On Ubuntu I use GIMP.

Details for Java Developers

I tried to use the SWT Program class to launch the external photo editing program. I never got it to work. Apparently the SWT Program class is intended to launch programs based on file associations, rather than launching a program with a specific file path, with a file path argument. Fortunately the Java ProcessBuilder class was able to launch a given program with a file path argument:

public void editPictureFile(Shell shell) {
if (canEditPictureFile()) {
String selectedItemPhotoPath = PhotoUtils.getPhotoPath(selectedItemPhotoPath());

 ProcessBuilder processBuilder = new ProcessBuilder(Globals.getPreferenceStore().getString(PreferenceKeys.PhotoEditingProgramPath), selectedItemPhotoPath);

 try {
processBuilder.start();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
Keywords: Vault 3, Edit Photo File, External Photo Editing Program, paint.net, GIMP, SWT, Program, ProcessBuilder

Reader Comments

Comment on this Blog Post

Recent Posts

TitleDate
Java Programming Tip: SWT Photo Frame ProgramOctober 31, 2016
Vault 3 (Desktop) Version 1.63 ReleasedSeptember 9, 2016
"Compliance with Court Orders Act of 2016"April 9, 2016
Disable "Visual Voicemail" on Android / T-MobileJanuary 17, 2016
IPv6 HumorDecember 10, 2015
Java Programming Tip: Specify the JVM time zoneDecember 7, 2015
Node.js / Express Programming Tip: Detect and Fix Memory LeaksOctober 27, 2015