private static File jpegtranExec(String filename, String arg1, String arg2, boolean crop) throws IOException {
private static File jpegtranExec(String filename, String arg1, String arg2, boolean crop) {
	private static File jpegtranExec(String filename, String arg1, String arg2, boolean crop) throws IOException {		File r;		ArrayList cmd = new ArrayList();		cmd.add(jpegtranPath);		cmd.add("-copy");		cmd.add("all");		//cmd.add("-debug");		cmd.add(arg1);		cmd.add(arg2);		r = deterministicTempFile(crop?"crop":"rot"				, "." + GalleryFileFilter.getExtension(filename), tmpDir, filename + arg1 + arg2);		toDelete.add(r);		cmd.add("-outfile");		cmd.add(r.getPath());		cmd.add(filename);		int exitValue = exec((String[]) cmd.toArray(new String[0]));		if ((exitValue != 0 && !jpegtranIgnoreErrorCode) || ! r.exists()) {			if (exitValue != -1 || ! r.exists()) {				// don't kill jpegtran if it's just an InterruptedException				if (crop) {					Log.log(Log.LEVEL_CRITICAL, MODULE, "jpegtran doesn't seem to be working for cropping. Disabling");					stopUsingJpegtranCrop();				} else {					Log.log(Log.LEVEL_CRITICAL, MODULE, "jpegtran doesn't seem to be working. Disabling");					stopUsingJpegtran();				}			}			r = null;		}		return r;	}