liyiguang / thumbnailator

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

Using toFiles(Rename) and asFiles(Rename) doesn't allow changing the output directory #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
.toFiles(Rename.PREFIX_DOT_THUMBNAIL) create the thumbnail in the source image 
directory.
Why not in the current directory? 

Original issue reported on code.google.com by lifeis...@gmail.com on 13 Aug 2013 at 6:01

GoogleCodeExporter commented 9 years ago
Thank you for taking your time to file a feature enhancement.

That's indeed a good point.

I'm not going to change the current behavior of the `toFiles(Rename)` and 
`asFiles(Rename)` methods, but I will consider adding a `toFiles` and `asFiles` 
methods which will accept a directory to which the thumbnails should be written 
to.

Original comment by coobird...@gmail.com on 25 Aug 2013 at 9:39

GoogleCodeExporter commented 9 years ago
Note to self:
I can imagine this to be common scenario, as I've been bitten by this problem 
recently.

I'm going to increase the priority of this issue.

Original comment by coobird...@gmail.com on 21 Dec 2013 at 11:02

GoogleCodeExporter commented 9 years ago
This feature is slated for release in Thumbnailator 0.4.7.

Original comment by coobird...@gmail.com on 22 Dec 2013 at 4:27

GoogleCodeExporter commented 9 years ago
A feature to specify the output directory for the `toFiles` and `asFiles` 
methods has been added in Thumbnailator 0.4.7.

Something like the below should now allow output to the current directory:

  File currentDirectory = new File(System.getProperty("user.dir"));

  Thumbnails.of(files)
    .size(100, 100)
    .toFiles(currentDirectory, Rename.PREFIX_DOT_THUMBNAIL);

Original comment by coobird...@gmail.com on 23 Dec 2013 at 5:30