Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized Multiple Thumbs From Single File #29

Open
GoogleCodeExporter opened this issue Apr 14, 2015 · 5 comments
Open

Optimized Multiple Thumbs From Single File #29

GoogleCodeExporter opened this issue Apr 14, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

In one use case, multiple thumbnails of various sizes are made from a single 
original.

Currently, the static interface will presumably (?) need to read the source 
file, which may be many MB, once for each thumbnail it generates.

Allow chaining of multiple .size / .toFile commands in such a way that the 
performance is optimized; as much as possible of the setup and file reading 
logic should be reused.


What is the expected output? What do you see instead?
Same as today, but faster.

What version of the product are you using? On what operating system? Which
version of Java?
I'm using 0.4.0 on Win x64 with JDK 1.7_03, it's working great!

Please provide any additional information below.


Original issue reported on code.google.com by jnad...@appignition.com on 6 Mar 2012 at 4:56

@GoogleCodeExporter
Copy link
Author

Thank you for the suggestion (and for the report that Thumbnailator is working 
with Java 7!)

As much as it would be neat if chaining `size` and the `toFile` methods, 
Thumbnailator's internals have been designed to perform one-to-one processing, 
and would probably require quite a bit of effort to efficiently create multiple 
thumbnails in a single pass.

Therefore, at the moment, I will not be addressing this issue.

However, this is definitely an interesting idea, so I'll keep this issue open 
for others to comment on, or star, in order to gauge interest.

--------------

Hypothetically, the API could be something like this:

  Thumbnails.of("path/to/image")
    .size(200, 200, "path/to/medium-thumbnail")
    .size(100, 100, "path/to/small-thumbnail")
    .size(50, 50, "path/to/tiny-thumbnail")
    .execute();

or,

  Thumbnails.of("path/to/image")
    .size(200, 200, "path/to/medium-thumbnail")
    .size(100, 100, "path/to/small-thumbnail")
    .size(50, 50)
    .toFile("path/to/tiny-thumbnail");

Original comment by coobird...@gmail.com on 10 Apr 2012 at 1:57

  • Changed state: Accepted
  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

@GoogleCodeExporter
Copy link
Author

just came across thumbnailator, and the first thing I thought was, how do I 
create multiple thumbnails of a single image?

Sounds like this is in progress, so, given current state of the application, 
how does one create multiple thumbnails based on single source image?

Original comment by sit1...@gmail.com on 22 Apr 2012 at 4:47

@GoogleCodeExporter
Copy link
Author

Actually the developer stated that there is no plan to address this.   I was 
hoping it would help give somewhat of an increase in performance (the 
performance is already good but I process a *lot* of files).   

I just do them sequentially.  What I do is create the biggest thumbnail first, 
then create all the subsequent thumbnails from the big thumbnail to avoid 
loading the original 5+mb images more than once.

Original comment by jnad...@appignition.com on 26 Apr 2012 at 12:19

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Yes, this will be useful for us. We generate 4 thumbnails for each image. 
Thanks jnad...@appignition.com. I think i will try this approach as well (us 
the 1st thumbnail to generate others).

Original comment by jain...@gmail.com on 22 May 2013 at 3:26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant