DZone

Ever since our phones became a multi-purpose tool and included a high-quality camera as one of the features, photos have become an even more important and present aspect of our lives. We use photos to capture memories and moments that we would previously miss without a camera, and we also upload them as profile pictures to identify ourselves on various professional and social websites. 

You’ve probably noticed that most sites that allow users to upload profile pictures automatically crop the image to a particular shape and/or angle; this is done behind the scenes and ensures image consistency across the site. Cropping, or the removal of a specific part of an image, can be performed for various reasons but most frequently its purpose is to zoom in on a certain part of the photo and removed unwanted or unnecessary objects/space. If your business has a website or application that allows users to upload images, it can be beneficial to set up some of these built-in parameters. To that end, the following tutorial will discuss how to use an API in Java to automatically rotate an image and/or crop the image to a circular or rectangular shape all while maintaining the aspect ratio. 

Source: DZone