if (d == null || d.equals(new Dimension(0, 0))) { d = null;
if (i <= 0) {
	public File getUploadSource() {		boolean useLossyCrop = false;		File picture = getSource();		Album album = getParentAlbum();		// crop		if (cropTo != null) {			try {				picture = ImageUtils.losslessCrop(picture.getPath(), cropTo);			} catch (UnsupportedOperationException e) {				Log.log(Log.LEVEL_ERROR, MODULE, "Couldn't use ImageUtils to losslessly crop the image, will try lossy");				Log.logException(Log.LEVEL_ERROR, MODULE, e);				useLossyCrop = true;			}		}		// resize		if (album.getResize()) {			Dimension d = album.getResizeDimension();			if (d == null || d.equals(new Dimension(0, 0))) {				d = null;				int l = album.getServerAutoResize();				if (l != 0) {					d = new Dimension(l, l);				} else {					// server can't tell us how to resize, try default					d = GalleryRemote._().properties.getDimensionProperty(RESIZE_TO_DEFAULT);					if (d.equals(new Dimension(0, 0))) {						d = null;					}				}			}			if (d != null || useLossyCrop) {				try {					picture = ImageUtils.resize(picture.getPath(), d, useLossyCrop?cropTo:null);				} catch (UnsupportedOperationException e) {					Log.log(Log.LEVEL_ERROR, MODULE, "Couldn't use ImageUtils to resize the image, it will be uploaded at the original size");					Log.logException(Log.LEVEL_ERROR, MODULE, e);				}			}		} else if (useLossyCrop) {			picture = ImageUtils.resize(picture.getPath(), null, useLossyCrop?cropTo:null);		}		// rotate		if (angle != 0 || flipped) {			try {				picture = ImageUtils.rotate(picture.getPath(), angle, flipped, true);			} catch (UnsupportedOperationException e) {				Log.log(Log.LEVEL_ERROR, MODULE, "Couldn't use jpegtran to resize the image, it will be uploaded unrotated");				Log.logException(Log.LEVEL_ERROR, MODULE, e);			}		}		return picture;	}