GithubHelp home page GithubHelp logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
Hello!

Thank you for your suggestion.

I've received a request for a similar feature via e-mail from another user of 
Thumbnailator, so I think there is a real need for this feature.

Currently, Thumbnailator allows *post*-processing of thumbnails, but no 
*pre*-processing (such as cropping) of the original image before the image is 
resized.

Therefore, I'll definitely look into implementing this feature, probably in 
early April.

Any feedback on specific use cases are greatly welcome.

Chris

---

P.S. Thumbnailator 0.3.2 has introduced the `Canvas` image filter 
(http://thumbnailator.googlecode.com/hg/javadoc/net/coobird/thumbnailator/filter
s/Canvas.html) which will allow the thumbnail to be cropped.

However, as mentioned earlier, this affects the *thumbnail* -- the cropping 
takes effect on the thumbnail, not the original image.

P.P.S I'm going to reclassify this as a "Type-Enhancement" to reflect the type 
of issue this is.

Original comment by [email protected] on 29 Mar 2011 at 4:01

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
Very much looking forward!
this feature is useful for me.

Original comment by [email protected] on 31 Mar 2011 at 4:29

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
I want download an original image and add my logo
The feature is what i'm looking for. :D

Original comment by [email protected] on 8 Apr 2011 at 3:33

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
Work has commenced on a feature to be able to specify the region of the source 
image to use when creating a thumbnail.

For example, creating a 200x200 thumbnail from the center 400x400 region of the 
source image could be written like the following*:

  Thumbnails.of("/path/to/image")
    .sourceRegion(Positions.CENTER, 400, 400)
    .size(200, 200)
    .toFile("/path/to/thumbnail")

* Final APIs are subject to change.

The work is underway in the `source-region` branch:
http://code.google.com/p/thumbnailator/source/browse/?r=source-region

Original comment by [email protected] on 23 Apr 2011 at 6:20

  • Changed state: Started

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
A new feature enhancement has been released as part of Thumbnailator 0.3.4.

Now it is possible to specify the source region to use when creating a 
thumbnail through the `Thumbnails` fluent interface.

The example shown in Comment 4 is now possible, along with a few more options 
for specifying the size and position.

For more information, please refer to the "Changes" for 0.3.4:
http://code.google.com/p/thumbnailator/wiki/Changes#Thumbnailator_0.3.4_%28May_3
,_2011%29

Original comment by [email protected] on 3 May 2011 at 12:17

  • Changed state: Fixed

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
Since you don't mention that it is an error, I presume that the source region 
can be bigger than the image. When this is the case how do you specify the 
colour used the pad the source image?

Original comment by [email protected] on 15 Jun 2011 at 10:46

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
Hello [email protected],

Indeed, it is not an error to specify a source region that is larger than the 
original image.

I realize that the `sourceRegion(...)` method is poorly documented, but the 
behavior for this scenario is that the region outside of the original image 
will simply be ignored -- in essence the final source image region is an 
intersection of the original image size and the specified source region.

For example, if the original was 200x200, and the source region was 400x400 at 
(0,0), the resulting image will be 200x200.

This behavior was specified this in the back-end processing class 
(`Region.calculate` - 
http://thumbnailator.googlecode.com/hg/javadoc/net/coobird/thumbnailator/geometr
y/Region.html#calculate(int,%20int)), but neglected to include the details in 
the `sourceRegion` method; I'll be sure to document this in the next release.

The answer to the final question is, there isn't a way to specify the padding 
color, as the current behavior does not perform padding.

If a feature to pad the source region outside of the original image is a 
feature that is needed, please file a new issue for a feature enhancement. (Or 
let me know and I'll add one when I get a little more free time.)

Thanks!

Original comment by [email protected] on 15 Jun 2011 at 2:11

from thumbnailator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.