Giter VIP home page Giter VIP logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024

Original comment by [email protected] on 29 Jun 2013 at 6:57

  • Changed state: Started

from thumbnailator.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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)

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.