} else {
            float aspectRatio = alteredBitmap.getHeight() / (float) alteredBitmap.getWidth();
            int width = Math.round(h / aspectRatio);
            alteredBitmap = Bitmap.createScaledBitmap(
                    alteredBitmap, width, h, false);