Skip to content

Today, thumbnailator doesn't permit to create a thumbnail keeping aspect ratio AND forcing a defined size #24

@GoogleCodeExporter

Description

@GoogleCodeExporter
I need to create thumbnails similar to the Facebook ones. What Facebook do is 
maintain the aspect ratio, but forcing a defined size of thumbnail.

It resizes the image to the defined size and then cuts what is left, forcing 
the height or the width (and avoiding blank spaces around the image). For me is 
the best approach when we talk about thumbnails.

I tried to use something like this:

Thumbnails.of(myInputStream).forceSize(width, 
height).keepAspectRatio(true).outputFormat("jpg").outputQuality(1.0f).toOutputSt
ream(myOutputStream);

But it does not work. I think this approach is not possible yet with 
thumbnailator so can you implement it? Just a suggestion to make this library 
even better (it is definately the best and simplest all over the web).

Thanks in advance.

Original issue reported on code.google.com by lua...@gmail.com on 13 Oct 2011 at 8:06

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions