Is there any open source library available in android for image resizing?

I want to know if there are open source libraries available for image resizing on Android. Because in my application, I used a camera to capture an image. Supported image sizes differ from device to device. So, here I used the largest device size, for example HTC Wildfire has 19 sizes, I used 2592x 1952 (WxH). Here I want to resize an actual 250x250 image without losing or stretching the image. I searched google and StackOverflow, I got this Thumbnailator and imgscalr solutionunfortunately i cant implement in my app (i dont know what android supports it, if so then kindly post the solution how can i implement). When I add ThumNailator folder to / libs folder and add this piece of code to my code,

            Thumbnails.of(new File(sdRoot + dir + fileName).listFiles())
                    .size(100, 100).outputFormat("JPEG")
                    .outputQuality(0.85)
                    .toFiles(Rename.PREFIX_DOT_THUMBNAIL);

      

it shows notification like "The type java.awt.image.BufferedImage cannot be resolved. It is indirectly referenced from required .class files"

. How can I resize the captured image with my custom size.

+1


source to share





All Articles