iFrankWu / thumbnailator

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

Javadoc on Thumbnailator class has unclear remark on OutOfMemoryError #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The javadoc on the class Thumbnailator has the following note:

---
Note: This class does not provide good support for large images. For very large 
images, it is possible for an OutOfMemoryError to occur during processing.

---

I suggest removing this note from this class and just tell that this class uses 
Thumbnails.of... to produce images.

And at the class Thumbnails you can say that it has no good support for very 
large images; why? because the whole image file has to be loaded into the heap 
memory ...

-----
Thanks for the great library!

Original issue reported on code.google.com by igor.muk...@googlemail.com on 28 Apr 2014 at 10:28

GoogleCodeExporter commented 9 years ago
First of all, thank you for taking the time to write about this issue.

I agree that the note doesn't really belong in the Javadoc for the 
`Thumbnailator` class -- considering that the issue with not handing large 
images is a issue that the entire Thumbnailator library faces (Issue 1) it's 
not isolated to the code in the `Thumbnailator` class.

Therefore, I will remove the note about causing `OutOfMemoryError`s from the 
`Thumbnailator` class.

(The use of `Thumbnails.of` from the `Thumbnailator` class methods is an 
implementation detail, so I'll skip adding that to the javadocs.)

Once again, thank you for giving attention to this issue! :)

----

Some insights into how Thumbnailator currently works under the hood:

The `Thumbnails.of` pathway actually uses the 
`Thumbnailator.createThumbnail(ThumbnailTask)` method as the core resizing 
routine, so that note about causing `OutOfMemoryError`s is not technically 
incorrect, but it's not really necessary, as it's a problem with the 
implementation of the current version of Thumbnailator.

Some of the `Thumbnailator` class methods do use the `Thumbnails.of` method to 
create thumbnails, but those were a result of retrofitting the implementation 
to use the `Thumbnails.of` pathway later on, as new features were added to 
`Thumbnails.of` (such as support for Exif rotation, etc.) but were not being 
applied when using the `Thumbnailator` class methods. (Issue 43)

Original comment by coobird...@gmail.com on 29 Apr 2014 at 7:12

GoogleCodeExporter commented 9 years ago
This issue will be addressed in Thumbnailator 0.4.8.

Original comment by coobird...@gmail.com on 26 Oct 2014 at 5:22

GoogleCodeExporter commented 9 years ago
This issue has been addressed in Thumbnailator 0.4.8.

Original comment by coobird...@gmail.com on 1 Dec 2014 at 2:59