Search Posts

How to Scale An Image Maintaining Aspect Ratio Using java-image-scaling API

Get link

Facebook

Twitter

Pinterest

Email

Other Apps

Below is the static function that I use to scale images in Java using Java Image Scaling 0.8.5 API. When user uploads a file, I pass that file as InputStream to this function, with StandardSize and ThumbSize, the function saves the images at passed fileStorePath with name "newFileName". It also maintains the aspect ratio for thumb and standard image both.