Comments (12)
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.
Hmmm..
NullPointerException
s 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.
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 0x00
s 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.
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.
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.
Just pushed a fix.
from twelvemonkeys.
Thanks! ...and yes, you're right. It seems MacOS uses the damaged embedded thumbnail while rendering the file (preview) icon.
from twelvemonkeys.
Cool. I'm home free then. ;-)
from twelvemonkeys.
Thanks for this fix and the great job you have done with this library!
from twelvemonkeys.
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.
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.
@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)
- ClassCastException ImageReadParam BigTIFF reading HOT 2
- jakarta.servlet support HOT 2
- Allow tiff writing to use an explicit photometric interpretation option HOT 7
- Enable a SAST Tool
- CVE-2023-5129 - Vulnerability in libwebp huffman table implementation HOT 2
- Question: compatibility with org.apache.commons:commons-imaging ? HOT 2
- Features stopped working after upgrading to JDK 17 HOT 8
- It would be nice if Twelvemonkeys had support for EXIF tag 0xa436 Title HOT 10
- Problematic inconsistence in JPEG color space detection: TwelveMonkey vs standard Java API HOT 9
- Wrong colors with CMYK JPEG HOT 1
- Webp: cannot decode grayscale images HOT 5
- NPE while read a PSD file HOT 3
- Unable to modify a JPEGImage10Metadata comment value HOT 17
- JPEG: Preserve metadata when writing CMYK HOT 5
- The OSGi support only exports the ImageReaderSpi services and not the ImageWriterSpi services HOT 1
- BMP: Write support for more ARGB types HOT 1
- Some malformed PSD images never return from `ImageIO.read()` using 3.10.0 HOT 2
- WebP: Images decoded with yellow tint HOT 1
- Possible bug in Half.shortBitsToFloat HOT 5
- Troubleshooting with ImageIO plugin registry issue (NoClassDefFoundErrors) without web.xml file 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 twelvemonkeys.