Change image resolution via java code

Asked

Viewed 359 times

0

speaks galera to coming up with a program to automate posting on a blog, and I need the images to be 500x500 always have how I receive the file and resize via code in java?

1 answer

0


There is always a way rs, take a look at the library Thumbnailator, does exactly what you need and without writing too much code.

Example:

Thumbnails.of(new File("imagem.jpg"))
    .size(500, 500)
    .toFile(new File("nova_imagem.jpg"));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.