Git Product home page Git Product logo

Comments (12)

Dima-HAN avatar Dima-HAN commented on May 23, 2024

Did not work for me too, here is an exception if it helps

java.lang.NullPointerException
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getSourceCSType(Unknown Source)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1308)

from twelvemonkeys.

haraldk avatar haraldk commented on May 23, 2024

Hmmm..

NullPointerExceptions are never good. I'll look into it, as soon as possible.

As always, thanks for reporting and providing test a case!

.k

from twelvemonkeys.

haraldk avatar haraldk commented on May 23, 2024

Hi Marcus,

Less time in my day job these days to fix issues like this.. But I finally found some time today, and identified the problem. There seems to a lot of trash/padding 0x00s between two JPEG markers, apparently for no good reason. Don't think this is allowed according to spec, but seems to be common (google for "Corrupt JPEG data: extraneous bytes before marker"). I can probably mask these bytes out of the stream, and handle in some way, but I need to work out a good strategy first... Stay tuned. :-)

Harald K

from twelvemonkeys.

marcuslinke avatar marcuslinke commented on May 23, 2024

Hi Harald, thanks for your effort so far. I just wonder how many different JPEG spec violations are out there that must be considered... seems like an unsolvable task to me :-(

from twelvemonkeys.

haraldk avatar haraldk commented on May 23, 2024

Well..

If I only knew upfront all the different spec violations there was...
As long as handling one type of violation doesn't rule out reading other images (which is still the case), I think we're good. :-)

I made the reader able to read your image. I just want to provide better warning feedback to the listeners and clean things up a little before checking in.

Side note: The (Exif?) thumbnail seems broken (correct data bout 2/3 down, then nothing). Is this the case in other software too?

Best regards,

Harald K

from twelvemonkeys.

haraldk avatar haraldk commented on May 23, 2024

Just pushed a fix.

from twelvemonkeys.

marcuslinke avatar marcuslinke commented on May 23, 2024

Thanks! ...and yes, you're right. It seems MacOS uses the damaged embedded thumbnail while rendering the file (preview) icon.

from twelvemonkeys.

haraldk avatar haraldk commented on May 23, 2024

Cool. I'm home free then. ;-)

from twelvemonkeys.

galusben avatar galusben commented on May 23, 2024

Thanks for this fix and the great job you have done with this library!

from twelvemonkeys.

huxi avatar huxi commented on May 23, 2024

Has this fix been released? I see a similar issue with 3.0 but didn't check 3.0.2 yet. Will do so now...

from twelvemonkeys.

huxi avatar huxi commented on May 23, 2024

Alright... I got a NPE at

    com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getSourceCSType(Unknown Source)
    com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
    javax.imageio.ImageReader.read(ImageReader.java:939)

But the reason for this was that the image with a jpeg extension was actually a png. Changing the extension the png fixed the problem. Should I file a new issue for that?

from twelvemonkeys.

haraldk avatar haraldk commented on May 23, 2024

@huxi My plugins does not do file format recognition by looking at file extensions, so I'm not sure how that happened... But yes, file an issue, with the code you are using and attach the image you used, and I'll look into it.

The original issue has been fixed, at least both 3.0.1 and 3.0.2 has no problems reading the linked image.

Harald K

from twelvemonkeys.

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.