} catch (IOException e1) { Log.logException(Log.LEVEL_ERROR, MODULE, e1);
	public static File rotate(String filename, int angle, boolean flip, boolean resetExifOrientation) {		File r = null;		if (!GalleryFileFilter.canManipulateJpeg(filename)) {			Log.log(Log.LEVEL_TRACE, MODULE, "jpegtran doesn't support rotating anything but jpeg");			return new File(filename);		}		if (useJpegtran) {			File orig = null;			File dest = null;			try {				if (GalleryRemote.IS_MAC_OS_X) {					orig = new File(filename);					dest = deterministicTempFile("tmp"							, "." + GalleryFileFilter.getExtension(filename), tmpDir, filename + angle + flip);					orig.renameTo(dest);					filename = dest.getPath();				}				if (flip) {					r = jpegtranExec(filename, "-flip", "horizontal", false);					filename = r.getPath();				}				if (angle != 0) {					r = jpegtranExec(filename, "-rotate", "" + (angle * 90), false);				}				/*if (resetExifOrientation) {				resetExifOrientation(filename);				}*/			} catch (IOException e1) {				Log.logException(Log.LEVEL_ERROR, MODULE, e1);			} finally {				if (orig != null && dest != null) {					dest.renameTo(orig);				}			}		}		if (!useJpegtran && r == null) {			throw new UnsupportedOperationException("jpegtran must be installed for this operation");		}		return r;	}