I have searched and found a few image scaling libraries for Java. But not sure which one to go with. I need to generate thumbnails from the image uploaded by server.
It would be great if you can tell which one's good and bad.
The list I have is:
For my simple needs, Thumbnailator was perfect. Small lib; fluent, clean, well-documented API.
In my case, it was just "net.coobird" % "thumbnailator" % "0.4.8"
dependency and:
//..
Thumbnails.of(originalFile)
.size(300, 300)
.toFile(thumbnailFile)
//..
and done. Basically it’s a friendly wrapper on top of the Java 2D APIs. Useful for specific (thumbnailin') needs; no learning curve.
Unless you really need to do some heavy-lifting with images, I'd be wary of depending on an external binary (ImageMagick and wrappers like JMagick), which would add complexity and moving parts into the setup. Especially if your stack is something like mine: Scala/Java app running on Heroku. There’s stuff like heroku-buildpack-imagemagick-cedar-14
, yes, but a simple dependency bundled with the app is infinitely cleaner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With