Log.logException(Log.ERROR, MODULE, e);
Log.logException(Log.LEVEL_ERROR, MODULE, e);
	public static AngleFlip getExifTargetOrientation(String filename) {		if (GalleryFileFilter.canManipulateJpeg(filename)) {			File jpegFile = new File(filename);			try {				Metadata metadata = JpegMetadataReader.readMetadata(jpegFile);				Directory exifDirectory = metadata.getDirectory(ExifDirectory.class);				String orientation = exifDirectory.getString(ExifDirectory.TAG_ORIENTATION);				if (orientation == null) {					Log.log(Log.TRACE, MODULE, "Picture " + filename + " has no EXIF ORIENTATION tag");					return null;				} else {					Log.log(Log.TRACE, MODULE, "Picture " + filename + " EXIF ORIENTATION: " + orientation);					int or = 0;					AngleFlip af = null;					try {						or = Integer.parseInt(orientation);					} catch (NumberFormatException e) {						Log.log(Log.ERROR, MODULE, "Couldn't parse orientation " + orientation + " for " + filename);						return null;					}					switch (or) {						case 1:							af = new AngleFlip(0, false);							break;						case 2:							af = new AngleFlip(0, true);							break;						case 3:							af = new AngleFlip(2, false);							break;						case 4:							af = new AngleFlip(2, true);							break;						case 5:							af = new AngleFlip(1, true);							break;						case 6:							af = new AngleFlip(1, false);							break;						case 7:							af = new AngleFlip(3, true);							break;						case 8:							af = new AngleFlip(3, false);							break;						default:							Log.log(Log.ERROR, MODULE, "Couldn't parse orientation " + orientation + " for " + filename);							return null;					}					Log.log(Log.TRACE, MODULE, "Angle: " + af.angle + " Flipped: " + af.flip);					return af;				}			} catch (FileNotFoundException e) {				Log.logException(Log.ERROR, MODULE, e);				return null;			} catch (JpegProcessingException e) {				Log.logException(Log.ERROR, MODULE, e);				return null;			}		} else {			return null;		}	}