Comments (7)
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.
Very much looking forward!
this feature is useful for me.
Original comment by [email protected]
on 31 Mar 2011 at 4:29
from thumbnailator.
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.
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.
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.
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.
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)
- Watermark position incorrect for images re-oriented using EXIF metadata HOT 3
- Move to GitHub (and transition to a Git repository) HOT 5
- Change build from Ant to Maven HOT 4
- Google Project Hosting will drop support for Downloads HOT 3
- Using JAI library? HOT 1
- Thumbnailing problem for a specific JPEG image HOT 1
- OutOfMemoryError: Java heap space / Builder.asBufferedImage HOT 3
- Exception on opening nested folder HOT 5
- Recursively process images in nested directories
- Low quality when resizing a GIF image HOT 2
- Unexpected behaviour when using toFile without an extension matching output format HOT 1
- Support animated GIFs HOT 2
- Javadoc on Thumbnailator class has unclear remark on OutOfMemoryError HOT 3
- Implement a workaround for common OutOfMemoryError cases HOT 15
- java.lang.OutOfMemoryError: Java heap space after adding thumbnailator-feature-oom-workaround-SNAPSHOT.jar file HOT 6
- Please retain debug information in published JAR HOT 3
- forceSize Not maintaining the Aspect Ratio of thr original image HOT 5
- "Image cannot be null" when using `Thumbnails.of(BufferedImage...)` HOT 2
- Use embedded thumbnail from large JPEG images HOT 1
- SVG not supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thumbnailator.