linpeixun / thumbnailator

Automatically exported from code.google.com/p/thumbnailator
Other
0 stars 0 forks source link

Ability to resize based on width or height, and adjust the other value accordingly #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The plugin seems to require both width and height values to be entered, which 
rules out the ability to scale an image according to either its width/height 
proportionately.

Is there a way to achieve this please? 

Original issue reported on code.google.com by lin.fred...@gmail.com on 17 Jun 2011 at 7:32

GoogleCodeExporter commented 9 years ago
Work has begun on a feature to:

  1. Accept a width or height to use as a constraint, in order to create a thumbnail.
  2. The thumbnail will preserve the aspect ratio of the original image.

For example, if original image size is 200x400 and the specified width is 100, 
then the thumbnail size will be 100x200.

The code to perform the above image resizing would be the following:

   Thumbnails.of("path/to/image-200x400")
     .width(100)
     .toFile("path/to/thumbnail-100x200");

The changes will be released as part of Thumbnailator 0.3.5, which should be 
available within a day or so.

Original comment by coobird...@gmail.com on 18 Jun 2011 at 5:26

GoogleCodeExporter commented 9 years ago
This feature has been added in the Thumbnailator 0.3.5 release.

Please refer to the Changes for details:
http://code.google.com/p/thumbnailator/wiki/Changes#Thumbnailator_0.3.5_(June_18
,_2011)

Original comment by coobird...@gmail.com on 19 Jun 2011 at 4:24

GoogleCodeExporter commented 9 years ago
Thank you very much. :)

Original comment by lin.fred...@gmail.com on 22 Jun 2011 at 6:02