Comments (5)
Hi,
Thank you for reporting this issue, including a detailed description of the
problem.
Yes, I agree that the `Thumbnailator.createThumbnail(File, int, int)` method
not using the EXIF information would not be the expected behavior.
This should not be a very difficult issue to fix (I'll just redirect the
implementation of that method to use the `Thumbnails.of` code path) so it
shouldn't take too long to address this.
While I'm at it, I'll look into which methods in the `Thumbnailator` class is
actually useful, which methods should be deprecated in favor of the
`Thumbnails.of` interface.
(As a historic note, the `Thumbnailator` class actually existed before the
`Thumbnails.of` interface existed.)
I'm glad that you've found the library useful! :)
Original comment by [email protected]
on 27 May 2013 at 4:17
- Changed state: Accepted
- Added labels: Milestone-0.4.5
from thumbnailator.
I'm not sure if there is a reason for that, but EXIF data is ignored when using
BufferedImage as a source:
@Test
public void testExif() throws IOException { //run with Java 7
BufferedImage image = ImageIO.read(new File("/home/denisk/img/upload.jpg")); //image rotated according to EXIF
ByteArrayInputStream is = new ByteArrayInputStream(Files.readAllBytes(Paths.get("/home/denisk/img/upload.jpg")));
Thumbnails.of(image) //this produces not rotated image
.size(800, 600)
.outputFormat("jpg")
.toOutputStream(new FileOutputStream("/tmp/img-not_rotated.jpg"));
Thumbnails.of(is) //this produces rotated image
.size(800, 600)
.outputFormat("jpg")
.toOutputStream(new FileOutputStream("/tmp/img-rotated.jpg"));
}
This seems to happen because in
net.coobird.thumbnailator.tasks.io.BufferedImageSource#read method there is no
use of param.useExifOrientation() method. If there is a reason for that,
please comment.
Original comment by [email protected]
on 10 Jun 2013 at 3:15
from thumbnailator.
Hi,
The reason using `Thumbnails.of(BufferedImage)` does not perform a rotation
according to the Exif metadata is because the `BufferedImage` object does not
contain Exif metadata.
(The metadata is lost when using `ImageIO.read` to obtain the `BufferedImage`.)
On the other hand, using the `Thumbnails.of(InputStream)` does allow rotation
using Exif, because the `InputStream` is returning the byte stream of the JPEG
image which contains the Exif metadata.
So, the issue isn't that the Exif metadata is being ignored for the
`BufferedImage` case, it's just that the Exif metadata doesn't exist when
handling `BufferedImage`s.
------
Note: In the future, please create a new issue if the issue you're having does
not directly apply to the issue at hand -- this issue deals with the behavior
of the `Thumbnailator.createThumbnail` method.
Original comment by [email protected]
on 11 Jun 2013 at 1:32
from thumbnailator.
Original comment by [email protected]
on 29 Jun 2013 at 6:57
- Changed state: Started
from thumbnailator.
This issue has been addressed in Thumbnailator 0.4.5.
Original comment by [email protected]
on 30 Jun 2013 at 11:38
- Changed state: Fixed
from thumbnailator.
Related Issues (20)
- How to ensure the GIF dynamic effect after compression HOT 1
- Do you have plans to support WebP, AVIF? HOT 1
- Thumbnail not properly generating from PNG images HOT 2
- Image color loss during conversion HOT 3
- Define an Automatic-Module-Name HOT 1
- the image format webp is not support HOT 5
- No suitable ImageReader found for source data errors HOT 1
- After resize the image is rotated HOT 3
- 300dpi tiff image changed to 96pi jpg but pixel does not chage HOT 1
- Incorrect cropping when specifying sourceRegion and an image that has exif orientation HOT 2
- Multi-threaded processing of images with large pixel width and height leads to memory OutOfMemoryError
- the .pict file is not supported HOT 1
- javax.imageio.IIOException: Invalid JPEG file structure: two SOF markers HOT 1
- Add crop method usage to examples HOT 2
- How to make the image width fixed when the image is scaled HOT 1
- Does the thumbnailator support generating thumbnails for png images? HOT 1
- Conversion error caused by image reading failure
- Native image service unable to compress image
- jpg color turn red HOT 2
- webp format image campress fail with exception "No suitable ImageReader found for source data" HOT 1
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.