public Size getDesiredPreviewSize(boolean rotate) {
        if (viewfinderSize == null) {
            return null;
        } else if (rotate) {
            return viewfinderSize.rotate();
        } else {
            return viewfinderSize;
        }
    }
@param rotate true to rotate the preview size
@return desired preview size in natural camera orientation.
zxing-android-embedded/src/com/journeyapps/barcodescanner/camera/DisplayConfiguration.java